public override ScriptCode MakeScriptCode(PythonAst ast) {
            PythonCompilerOptions pco = ast.CompilerContext.Options as PythonCompilerOptions;
            // reduce to LightLambda then to Lambda
            var code = (MSAst.Expression<LookupCompilationDelegate>)ast.Reduce().Reduce();

            return new PythonSavableScriptCode(code, ast.SourceUnit, ast.GetNames(), pco.ModuleName);
        }
Example #2
0
        public override ScriptCode MakeScriptCode(PythonAst ast)
        {
            PythonCompilerOptions pco = ast.CompilerContext.Options as PythonCompilerOptions;
            // reduce to LightLambda then to Lambda
            var code = (MSAst.Expression <LookupCompilationDelegate>)ast.Reduce().Reduce();

            return(new PythonSavableScriptCode(code, ast.SourceUnit, ast.GetNames(), pco.ModuleName));
        }
Example #3
0
        public override ScriptCode MakeScriptCode(PythonAst ast)
        {
            PythonCompilerOptions pco = ast.CompilerContext.Options as PythonCompilerOptions;
            var code = (MSAst.Expression <Func <CodeContext /*!*/, FunctionCode /*!*/, object> >)ast.Reduce();

            return(new PythonSavableScriptCode(code, ast.SourceUnit, ast.GetNames(), pco.ModuleName));
        }
        public override ScriptCode MakeScriptCode(PythonAst ast) {
            PythonCompilerOptions pco = ast.CompilerContext.Options as PythonCompilerOptions;
            var code = (MSAst.Expression<Func<CodeContext/*!*/, FunctionCode/*!*/, object>>)ast.Reduce();

            return new PythonSavableScriptCode(code, ast.SourceUnit, ast.GetNames(), pco.ModuleName);
        }