コード例 #1
0
ファイル: Compiler.cs プロジェクト: robotii/sophielang
        private static void string_(Compiler c, bool allowAssignment)
        {
            int constant = c.StringConstant();

            // Compile the code to load the constant.
            c.EmitConstant(constant);
        }
コード例 #2
0
ファイル: Compiler.cs プロジェクト: robotii/sophielang
        private static void Number(Compiler c, bool allowAssignment)
        {
            if (c._parser.Number == 0.0)
            {
                c.Emit(Instruction.Zero);
                return;
            }
            if (c._parser.Number == 1.0)
            {
                c.Emit(Instruction.One);
                return;
            }
            int constant = c.AddConstant(new Obj(c._parser.Number));

            // Compile the code to load the constant.
            c.EmitConstant(constant);
        }