Ejemplo n.º 1
0
 public BuilderWithScope(BuilderWithScope parent, IIdentifier identifier, Scope scope)
 {
     Parent = parent;
     WithScope = new WithScope(parent != null ? parent.WithScope : null, identifier);
     Scope = scope;
 }
Ejemplo n.º 2
0
            public WithSyntax ExitWith(ExpressionSyntax expression, SyntaxNode body, SourceLocation location)
            {
                var result = new WithSyntax(expression, _withScope.WithScope.Identifier, body, location);

                _withScope = _withScope.Parent;

                return result;
            }
Ejemplo n.º 3
0
            private void CloseOverWithScope(BuilderWithScope withScope)
            {
                while (withScope != null)
                {
                    withScope.Scope._closedOverIdentifiers.Add(
                        (ResolvedIdentifier)withScope.WithScope.Identifier
                    );

                    withScope = withScope.Parent;
                }
            }
Ejemplo n.º 4
0
            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
                );
            }