summaryrefslogtreecommitdiff
path: root/shared/cplusplus/AST.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <qtc-committer@nokia.com>2009-01-06 11:45:04 +0100
committerRoberto Raggi <qtc-committer@nokia.com>2009-01-06 11:45:29 +0100
commit5a06e283e8777069b64891c0dfc05c97960866a6 (patch)
tree7f9f976988372d0f21b5ebc095b610f7bee1b922 /shared/cplusplus/AST.cpp
parente0c1943c5ce298748f069f68e29812d6eeac9491 (diff)
downloadqt-creator-5a06e283e8777069b64891c0dfc05c97960866a6.tar.gz
QualifiedNameAST::lastToken().
Diffstat (limited to 'shared/cplusplus/AST.cpp')
-rw-r--r--shared/cplusplus/AST.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp
index 13098ffa9d..b6ddde0c0e 100644
--- a/shared/cplusplus/AST.cpp
+++ b/shared/cplusplus/AST.cpp
@@ -2112,7 +2112,6 @@ unsigned PostIncrDecrAST::firstToken() const
unsigned PostIncrDecrAST::lastToken() const
{
- assert(0 && "review me");
return incr_decr_token + 1;
}
@@ -2132,7 +2131,6 @@ unsigned PostfixExpressionAST::firstToken() const
unsigned PostfixExpressionAST::lastToken() const
{
- assert(0 && "review me");
for (PostfixAST *it = postfix_expressions; it; it = it->next) {
if (! it->next)
return it->lastToken();
@@ -2159,12 +2157,18 @@ unsigned QualifiedNameAST::firstToken() const
unsigned QualifiedNameAST::lastToken() const
{
- assert(0 && "review me");
if (unqualified_name)
return unqualified_name->lastToken();
- else if (nested_name_specifier)
- return nested_name_specifier->lastToken();
- return global_scope_token + 1;
+
+ for (NestedNameSpecifierAST *it = nested_name_specifier; it; it = it->next) {
+ if (! it->next)
+ return it->lastToken();
+ }
+
+ if (global_scope_token)
+ return global_scope_token + 1;
+
+ return 0;
}
void ReferenceAST::accept0(ASTVisitor *visitor)