diff options
author | Roberto Raggi <qtc-committer@nokia.com> | 2009-01-02 17:59:27 +0100 |
---|---|---|
committer | Roberto Raggi <qtc-committer@nokia.com> | 2009-01-02 17:59:27 +0100 |
commit | 8d91577df9b9128854ae1090802a3336c6c0668a (patch) | |
tree | 259e53c53111e3a90287df182b3e47fd31c32569 /shared/cplusplus/AST.cpp | |
parent | 61dac8c9cf0569b983c0fa204ac207c659573e06 (diff) | |
download | qt-creator-8d91577df9b9128854ae1090802a3336c6c0668a.tar.gz |
Implemented ExceptionSpecificationAST::lastToken().
Diffstat (limited to 'shared/cplusplus/AST.cpp')
-rw-r--r-- | shared/cplusplus/AST.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp index 9952aa67f2..0926323ed0 100644 --- a/shared/cplusplus/AST.cpp +++ b/shared/cplusplus/AST.cpp @@ -1336,8 +1336,20 @@ unsigned ExceptionSpecificationAST::firstToken() const unsigned ExceptionSpecificationAST::lastToken() const { - assert(0 && "review me"); - return rparen_token + 1; + if (rparen_token) + return rparen_token + 1; + + for (ExpressionListAST *it = type_ids; it; it = it->next) { + if (! it->next && it->expression) + return it->expression->lastToken(); + } + + if (dot_dot_dot_token) + return dot_dot_dot_token + 1; + else if (lparen_token) + return lparen_token + 1; + + return throw_token + 1; } void ExpressionListAST::accept0(ASTVisitor *) |