Beispiel #1
0
        public void MethodDefinition(string name, string[] args, Action bodyBlock)
        {
            Instructions.Add(OpCode.ADD_FUNCTION);
            Instructions.AddInt(Instructions.AddString(name));
            Instructions.AddInt(args.Length);
            foreach (var arg in args)
            {
                Instructions.AddInt(Instructions.AddString(arg));
            }

            var endPos = Instructions.FillableInt();

            Instructions.Block(bodyBlock);

            Instructions.FillInt(endPos, Instructions.Count);
        }