Exemplo n.º 1
0
        public ExpressionScope Get(string name, ExpressionScopeType scopeType)
        {
            var depth    = this.Current.Depth + 1;
            var scopeKey = depth + name + "_" + scopeType;

            if (scopes.TryGetValue(scopeKey, out var scope))
            {
                return(scope);
            }

            return(Current = scopes[scopeKey] = new ExpressionScope(this, Current, name, scopeType, depth));
        }
Exemplo n.º 2
0
 internal ExpressionScope(IScopeProvider scopeProvider, ExpressionScope parent, string name, ExpressionScopeType scopeType, int depth)
 {
     this.scopeProvider = scopeProvider;
     this.Parent        = parent;
     this.name          = name;
     this.Type          = scopeType;
     this.Depth         = depth;
 }