예제 #1
0
        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);
        }