/// <summary> /// Initialize this instance. /// </summary> /// <param name="outerScope">Outer scope</param> /// <param name="functionScopeTable">Function scope table.</param> /// <param name="name">Easy to debug name.</param> public ScopeContext(ScopeContext outerScope, Dictionary <RawFunctionNode, ScopeContext> functionScopeTable, string name) { OuterScope = outerScope; _functions = new List <string>(); _innerScopes = new List <ScopeContext>(); _functionScopeTable = functionScopeTable; _scopeName = name; outerScope?.AddInnerScope(this); }
/// <summary> /// Adds the inner scope. /// </summary> /// <param name="scope">The scope.</param> private void AddInnerScope(ScopeContext scope) { _innerScopes.Add(scope); }
/// <summary> /// Initialize this instance. /// </summary> /// <param name="outerScope">Outer scope</param> /// <param name="name">Easy to debug name.</param> public ScopeContext(ScopeContext outerScope, string name) : this(outerScope, new Dictionary <RawFunctionNode, ScopeContext>(), name) { }