private BoundNode BindNamespace(NamespaceSyntax declaration) { var enclosingNamespace = LookupEnclosingNamespace(); var namespaceSymbol = new NamespaceSymbol(declaration, enclosingNamespace); AddSymbol(namespaceSymbol, declaration.Name.Span); var namespaceBinder = new NamespaceBinder(_sharedBinderState, this, namespaceSymbol); namespaceSymbol.Binder = namespaceBinder; var boundDeclarations = namespaceBinder.BindTopLevelDeclarations(declaration.Declarations, namespaceSymbol); foreach (var member in namespaceBinder.LocalSymbols.Values.SelectMany(x => x)) namespaceSymbol.AddMember(member); return new BoundNamespace(namespaceSymbol, boundDeclarations); }
public BoundNamespace(NamespaceSymbol namespaceSymbol, ImmutableArray<BoundNode> declarations) : base(BoundNodeKind.Namespace) { NamespaceSymbol = namespaceSymbol; Declarations = declarations; }
public NamespaceBinder(SharedBinderState sharedBinderState, Binder parent, NamespaceSymbol namespaceSymbol) : base(sharedBinderState, parent) { NamespaceSymbol = namespaceSymbol; }