コード例 #1
0
        public TypeReference ConstType(ast.Const cnst)
        {
            if (constTypes == null)
            {
                constTypes = new TypeReference[]
                {
                    assembly.MainModule.TypeSystem.String,

                    assembly.MainModule.TypeSystem.SByte,
                    assembly.MainModule.TypeSystem.Int16,
                    assembly.MainModule.TypeSystem.Int32,
                    assembly.MainModule.TypeSystem.Int64,

                    assembly.MainModule.TypeSystem.Byte,
                    assembly.MainModule.TypeSystem.UInt16,
                    assembly.MainModule.TypeSystem.UInt32,
                    assembly.MainModule.TypeSystem.UInt64,

                    assembly.MainModule.TypeSystem.Single,
                    assembly.MainModule.TypeSystem.Double
                };
            }
            return(constTypes[(int)cnst.kind]);
        }
コード例 #2
0
 public void LoadConst(ast.Const cnst, MethodDefinition method)
 {
     method.Body.GetILProcessor().Emit(OpCodes.Ret);
 }