public BuilderWithScope(BuilderWithScope parent, IIdentifier identifier, Scope scope) { Parent = parent; WithScope = new WithScope(parent != null ? parent.WithScope : null, identifier); Scope = scope; }
public WithSyntax ExitWith(ExpressionSyntax expression, SyntaxNode body, SourceLocation location) { var result = new WithSyntax(expression, _withScope.WithScope.Identifier, body, location); _withScope = _withScope.Parent; return result; }
private void CloseOverWithScope(BuilderWithScope withScope) { while (withScope != null) { withScope.Scope._closedOverIdentifiers.Add( (ResolvedIdentifier)withScope.WithScope.Identifier ); withScope = withScope.Parent; } }
public void EnterWith() { var identifier = new ResolvedIdentifier( WithPrefix + (_nextWithScopeIndex++).ToString(CultureInfo.InvariantCulture), null, IdentifierType.Local, true ); _resolvedIdentifiers.Add(identifier); _withScope = new BuilderWithScope( FindWithScope(false), identifier, this ); }