Inheritance: IBlockVisitor
示例#1
0
        public STObject EvaluateWith(Context context)
        {
            if (BlockArgumentNames.Length != 0)
                throw new Exception("Incorrect number of arguments for block (expected " + BlockArgumentNames.Length + ")");

            if (Compiled != null)
                throw new NotImplementedException();

            var eval = new BlockEvaluator (this, Compiler, context);
            Visit (eval);
            return eval.Result;
        }
示例#2
0
        public STObject Evaluate(STObject value, STObject value2)
        {
            if (BlockArgumentNames.Length != 2)
                throw new Exception("Incorrect number of arguments for block (expected " + BlockArgumentNames.Length + ")");

            Context.SetVariable(BlockArgumentNames[0], value);
            Context.SetVariable(BlockArgumentNames[1], value2);

            if (Compiled != null)
                throw new NotImplementedException();

            var eval = new BlockEvaluator (this, Compiler, this.Context);
            Visit (eval);
            return eval.Result;
        }