internal static PythonModule ExecuteSourceUnit(PythonContext context, SourceUnit /*!*/ sourceUnit) { ScriptCode compiledCode = sourceUnit.Compile(); Scope scope = compiledCode.CreateScope(); PythonModule res = ((PythonScopeExtension)context.EnsureScopeExtension(scope)).Module; compiledCode.Run(scope); return(res); }
internal Scope Execute(Scope globalScope, ScriptCode /*!*/ code) { if (globalScope == null || code.LanguageContext != _context) { if (globalScope == null) { globalScope = code.CreateScope(); } if (code.SourceUnit.Path != null) { LoadedScripts[Platform.GetFullPath(code.SourceUnit.Path)] = globalScope; } code.Run(globalScope); return(globalScope); } else { code.Run(globalScope); return(null); } }