From 308f481e841a6081b087ae179c64ab9e0cdbdcdd Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 13 Aug 2010 13:51:14 +0200 Subject: Bind using declarations and using namespace directives. --- src/shared/cplusplus/Bind.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/shared/cplusplus') diff --git a/src/shared/cplusplus/Bind.cpp b/src/shared/cplusplus/Bind.cpp index 752cd32ed6..a303cbad3b 100644 --- a/src/shared/cplusplus/Bind.cpp +++ b/src/shared/cplusplus/Bind.cpp @@ -1990,21 +1990,22 @@ bool Bind::visit(TemplateTypeParameterAST *ast) bool Bind::visit(UsingAST *ast) { - // unsigned using_token = ast->using_token; - // unsigned typename_token = ast->typename_token; - /*const Name *name =*/ this->name(ast->name); - // unsigned semicolon_token = ast->semicolon_token; - // UsingDeclaration *symbol = ast->symbol; + unsigned sourceLocation = ast->name ? ast->name->firstToken() : ast->firstToken(); + const Name *name = this->name(ast->name); + + UsingDeclaration *symbol = control()->newUsingDeclaration(sourceLocation, name); + ast->symbol = symbol; + _scope->addMember(symbol); return false; } bool Bind::visit(UsingDirectiveAST *ast) { - // unsigned using_token = ast->using_token; - // unsigned namespace_token = ast->namespace_token; - /*const Name *name =*/ this->name(ast->name); - // unsigned semicolon_token = ast->semicolon_token; - // UsingNamespaceDirective *symbol = ast->symbol; + unsigned sourceLocation = ast->name ? ast->name->firstToken() : ast->firstToken(); + const Name *name = this->name(ast->name); + UsingNamespaceDirective *symbol = control()->newUsingNamespaceDirective(sourceLocation, name); + ast->symbol = symbol; + _scope->addMember(symbol); return false; } -- cgit v1.2.1