diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-02-14 16:05:25 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-02-15 09:27:01 +0100 |
commit | f4163b8ba01cd1a4f5d91c83a3863939b7809375 (patch) | |
tree | 2d14b5bbfdb23896bbea2382db81af49be391862 /src/shared/cplusplus/CheckStatement.cpp | |
parent | 2a59d2ae0c889fe6e4ac50a3f110b0103f880c15 (diff) | |
download | qt-creator-f4163b8ba01cd1a4f5d91c83a3863939b7809375.tar.gz |
Added Objective-C @try block parsing.
Diffstat (limited to 'src/shared/cplusplus/CheckStatement.cpp')
-rw-r--r-- | src/shared/cplusplus/CheckStatement.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/shared/cplusplus/CheckStatement.cpp b/src/shared/cplusplus/CheckStatement.cpp index 26e4e7c835..dac65892ec 100644 --- a/src/shared/cplusplus/CheckStatement.cpp +++ b/src/shared/cplusplus/CheckStatement.cpp @@ -379,3 +379,35 @@ bool CheckStatement::visit(QtMemberDeclarationAST *ast) _exprType = FullySpecifiedType(); return false; } + +bool CheckStatement::visit(ObjCTryBlockStatementAST *ast) +{ + semantic()->check(ast->statement, _scope); + for (ObjCCatchClauseListAST *it = ast->catch_clause_list; it; it = it->next) { + semantic()->check(it->value, _scope); + } + _exprType = FullySpecifiedType(); + return false; +} + +bool CheckStatement::visit(ObjCCatchClauseAST *ast) +{ + Block *block = control()->newBlock(ast->at_token); + block->setStartOffset(tokenAt(ast->firstToken()).offset); + block->setEndOffset(tokenAt(ast->lastToken()).offset); + ast->symbol = block; + _scope->enterSymbol(block); + Scope *previousScope = switchScope(block->members()); + semantic()->check(ast->exception_declaration, _scope); + semantic()->check(ast->statement, _scope); + (void) switchScope(previousScope); + _exprType = FullySpecifiedType(); + return false; +} + +bool CheckStatement::visit(ObjCFinallyClauseAST *ast) +{ + semantic()->check(ast->statement, _scope); + _exprType = FullySpecifiedType(); + return false; +} |