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)); }
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; }