diff options
author | Roberto Raggi <qtc-committer@nokia.com> | 2009-01-06 11:30:42 +0100 |
---|---|---|
committer | Roberto Raggi <qtc-committer@nokia.com> | 2009-01-06 11:45:29 +0100 |
commit | 6f8b3d3d2dc65f1c2019c99d500de35261dcb3d6 (patch) | |
tree | 8ba81c6a53ee795b099c4a55a4f35e346db9ae5c /shared/cplusplus/AST.cpp | |
parent | bdfd5cada19a194484214544510f3cfa02ea79ac (diff) | |
download | qt-creator-6f8b3d3d2dc65f1c2019c99d500de35261dcb3d6.tar.gz |
Implemented NewExpressionAST::lastToken() and NewInitializerAST::lastToken().
Diffstat (limited to 'shared/cplusplus/AST.cpp')
-rw-r--r-- | shared/cplusplus/AST.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp index dcf3257361..96b941fddf 100644 --- a/shared/cplusplus/AST.cpp +++ b/shared/cplusplus/AST.cpp @@ -1860,7 +1860,6 @@ unsigned NewExpressionAST::firstToken() const unsigned NewExpressionAST::lastToken() const { - assert(0 && "review me"); if (new_initializer) return new_initializer->lastToken(); else if (new_type_id) @@ -1869,7 +1868,12 @@ unsigned NewExpressionAST::lastToken() const return type_id->lastToken(); else if (expression) return expression->lastToken(); - return new_token + 1; + else if (new_token) + return new_token + 1; + else if (scope_token) + return scope_token + 1; + // ### assert? + return 0; } void NewInitializerAST::accept0(ASTVisitor *visitor) @@ -1886,8 +1890,11 @@ unsigned NewInitializerAST::firstToken() const unsigned NewInitializerAST::lastToken() const { - assert(0 && "review me"); - return rparen_token + 1; + if (rparen_token) + return rparen_token + 1; + else if (expression) + return expression->lastToken(); + return lparen_token + 1; } void NewTypeIdAST::accept0(ASTVisitor *visitor) |