Commit 308f481e authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Bind using declarations and using namespace directives.

parent 1d30c09b
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment