Annotated NamespaceAST nodes.

This commit is contained in:
Roberto Raggi
2009-02-09 12:00:06 +01:00
parent 34efcf3194
commit 3ac4e05e37
2 changed files with 4 additions and 0 deletions

View File

@@ -1194,6 +1194,9 @@ public:
SpecifierAST *attributes;
DeclarationAST *linkage_body;
public: // annotations
Namespace *namespace_symbol;
public:
virtual unsigned firstToken() const;
virtual unsigned lastToken() const;

View File

@@ -286,6 +286,7 @@ bool CheckDeclaration::visit(NamespaceAST *ast)
Identifier *id = identifier(ast->identifier_token);
Name *namespaceName = control()->nameId(id);
Namespace *ns = control()->newNamespace(ast->firstToken(), namespaceName);
ast->namespace_symbol = ns;
_scope->enterSymbol(ns);
semantic()->check(ast->linkage_body, ns->members()); // ### we'll do the merge later.