public GetExtension ( ContextId languageContextId ) : Microsoft.Scripting.Runtime.ScopeExtension | ||
languageContextId | ContextId | |
return | Microsoft.Scripting.Runtime.ScopeExtension |
protected static CodeContext GetContextForScope(Scope scope, SourceUnit sourceUnit) { CodeContext ctx; var ext = scope.GetExtension(sourceUnit.LanguageContext.ContextId) as PythonScopeExtension; if (ext == null) { ext = sourceUnit.LanguageContext.EnsureScopeExtension(scope) as PythonScopeExtension; } ctx = ext.ModuleContext.GlobalContext; return ctx; }
// TODO: remove public ScopeExtension EnsureScopeExtension(Scope scope) { ContractUtils.RequiresNotNull(scope, "scope"); ScopeExtension extension = scope.GetExtension(ContextId); if (extension == null) { extension = CreateScopeExtension(scope); if (extension == null) { throw Error.MustReturnScopeExtension(); } return(scope.SetExtension(ContextId, extension)); } return(extension); }
public ScopeExtension GetScopeExtension(Scope scope) { ContractUtils.RequiresNotNull(scope, "scope"); return(scope.GetExtension(ContextId)); }