diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-13 10:42:48 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-13 10:42:48 +0200 |
commit | 9c7d70b02d95c05ef0887eced8dbfea9057e990b (patch) | |
tree | 9f1610d1eb8b71ea191a0ef8bcee40522b9cd52c /src/shared/cplusplus | |
parent | af28f72e6564f0a87a9c3662794bc69a84e8531e (diff) | |
download | qt-creator-9c7d70b02d95c05ef0887eced8dbfea9057e990b.tar.gz |
Bind NamespaceAST nodes.
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r-- | src/shared/cplusplus/Bind.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/shared/cplusplus/Bind.cpp b/src/shared/cplusplus/Bind.cpp index cb7dc7311a..1a048e6f23 100644 --- a/src/shared/cplusplus/Bind.cpp +++ b/src/shared/cplusplus/Bind.cpp @@ -1660,8 +1660,21 @@ bool Bind::visit(NamespaceAST *ast) for (SpecifierListAST *it = ast->attribute_list; it; it = it->next) { type = this->specifier(it->value, type); } + + unsigned sourceLocation = ast->firstToken(); + const Name *namespaceName = 0; + if (ast->identifier_token) { + sourceLocation = ast->identifier_token; + namespaceName = control()->nameId(identifier(ast->identifier_token)); + } + + Namespace *ns = control()->newNamespace(sourceLocation, namespaceName); + ast->symbol = ns; + _scope->addMember(ns); + + Scope *previousScope = switchScope(ns); this->declaration(ast->linkage_body); - // Namespace *symbol = ast->symbol; + (void) switchScope(previousScope); return false; } |