diff options
author | Roberto Raggi <qtc-committer@nokia.com> | 2009-01-06 12:01:57 +0100 |
---|---|---|
committer | Roberto Raggi <qtc-committer@nokia.com> | 2009-01-06 12:15:51 +0100 |
commit | 2fb5e63097dfb8b37896e71e0718d63844f64fc3 (patch) | |
tree | 3954f2f44477a05b0450dcc1309080b60b498371 /shared | |
parent | 0f3372118aa95acc2440ea2a44fb08a267091db1 (diff) | |
download | qt-creator-2fb5e63097dfb8b37896e71e0718d63844f64fc3.tar.gz |
TypeConstructorCallAST::lastToken().
Diffstat (limited to 'shared')
-rw-r--r-- | shared/cplusplus/AST.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp index 4ab7cdc424..8cb625b4ad 100644 --- a/shared/cplusplus/AST.cpp +++ b/shared/cplusplus/AST.cpp @@ -2499,7 +2499,6 @@ unsigned ThisExpressionAST::firstToken() const unsigned ThisExpressionAST::lastToken() const { - assert(0 && "review me"); return this_token + 1; } @@ -2517,7 +2516,6 @@ unsigned ThrowExpressionAST::firstToken() const unsigned ThrowExpressionAST::lastToken() const { - assert(0 && "review me"); if (expression) return expression->lastToken(); return throw_token + 1; @@ -2539,7 +2537,6 @@ unsigned TranslationUnitAST::firstToken() const unsigned TranslationUnitAST::lastToken() const { - assert(0 && "review me"); for (DeclarationAST *it = declarations; it; it = it->next) { if (! it->next) return it->lastToken(); @@ -2562,13 +2559,14 @@ unsigned TryBlockStatementAST::firstToken() const unsigned TryBlockStatementAST::lastToken() const { - assert(0 && "review me"); for (CatchClauseAST *it = catch_clause_seq; it; it = it->next) { if (! it->next) return it->lastToken(); } + if (statement) return statement->lastToken(); + return try_token + 1; } @@ -2590,8 +2588,24 @@ unsigned TypeConstructorCallAST::firstToken() const unsigned TypeConstructorCallAST::lastToken() const { - assert(0 && "review me"); - return rparen_token + 1; + if (rparen_token) + return rparen_token + 1; + + for (ExpressionListAST *it = expression_list; it; it = it->next) { + if (! it->next) + return it->lastToken(); + } + + if (lparen_token) + return lparen_token + 1; + + + for (SpecifierAST *it = type_specifier; it; it = it->next) { + if (! it->next) + return it->lastToken(); + } + + return 0; } void TypeIdAST::accept0(ASTVisitor *visitor) |