コード例 #1
0
 public virtual void InitScopeVars(AstScope parentScope)
 {
     Variables   = new Dictionary <string, SymbolDef>();
     Functions   = new Dictionary <string, SymbolDef>();
     UsesWith    = false;
     UsesEval    = false;
     ParentScope = parentScope;
     Enclosed    = new StructList <SymbolDef>();
     Cname       = 0;
 }
コード例 #2
0
 public override void InitScopeVars(AstScope parentScope)
 {
     base.InitScopeVars(parentScope);
     UsesArguments = false;
     // Arrow functions cannot use arguments
     if (!(this is AstArrow))
     {
         DefVariable(new AstSymbolFunarg(Start, End, "arguments"), null);
     }
 }
コード例 #3
0
ファイル: Extensions.cs プロジェクト: 0papen0/bbcore
        public static bool IsParentScopeFor(this AstScope parentScope, AstScope?potentiallyNestedScope)
        {
            var scope = potentiallyNestedScope;

            while (scope != null)
            {
                if (scope == parentScope)
                {
                    return(true);
                }
                scope = scope.ParentScope;
            }

            return(false);
        }