diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-13 11:38:48 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-13 11:38:48 +0200 |
commit | 76d3b8f5363ee7a0b3cb3d212be9f2107988b84c (patch) | |
tree | 9dbe3adb6e5dc83174a718abb6a765a6ded852b0 /src/shared/cplusplus | |
parent | d993cdb3d4ec14ada8b6471bca2b35987e713bf8 (diff) | |
download | qt-creator-76d3b8f5363ee7a0b3cb3d212be9f2107988b84c.tar.gz |
Process compound statements.
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r-- | src/shared/cplusplus/Bind.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/shared/cplusplus/Bind.cpp b/src/shared/cplusplus/Bind.cpp index 3e440efa81..e57a62bfaf 100644 --- a/src/shared/cplusplus/Bind.cpp +++ b/src/shared/cplusplus/Bind.cpp @@ -1036,12 +1036,14 @@ bool Bind::visit(CaseStatementAST *ast) bool Bind::visit(CompoundStatementAST *ast) { - // unsigned lbrace_token = ast->lbrace_token; + Block *block = control()->newBlock(ast->firstToken()); + ast->symbol = block; + _scope->addMember(block); + Scope *previousScope = switchScope(block); for (StatementListAST *it = ast->statement_list; it; it = it->next) { this->statement(it->value); } - // unsigned rbrace_token = ast->rbrace_token; - // Block *symbol = ast->symbol; + (void) switchScope(previousScope); return false; } @@ -1708,10 +1710,13 @@ bool Bind::visit(FunctionDefinitionAST *ast) this->ctorInitializer(ast->ctor_initializer, fun); - if (! _skipFunctionBodies) { + if (! _skipFunctionBodies && ast->function_body) { Scope *previousScope = switchScope(fun); this->statement(ast->function_body); (void) switchScope(previousScope); + + if (CompoundStatementAST *c = ast->function_body->asCompoundStatement()) + fun->setBlock(c->symbol); } // Function *symbol = ast->symbol; |