コード例 #1
0
        static object EvalCode(string code)
        {
            var expr = AstBuilder.ParseExpr(AstBuilder.CreateParser("test", code));

            Console.WriteLine(expr);

            var compiler      = new FunctionCompiler(new ModuleScope(module));
            var compiledValue = compiler.CompileExpr(expr);

            // Console.WriteLine("code: " + Util.ExpressionStringBuilder.ExpressionToString(compiledValue.Expression));
            return(ExprUtil.EvaluateNow(compiledValue.Expression));
        }