summaryrefslogtreecommitdiff
path: root/shared/cplusplus/AST.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <qtc-committer@nokia.com>2009-01-06 12:13:49 +0100
committerRoberto Raggi <qtc-committer@nokia.com>2009-01-06 12:15:51 +0100
commit03854281da39790878062c00eb46b03c9b5beeb1 (patch)
treea22d51e8261d3e788b8b3e6472a2c053a65d15c4 /shared/cplusplus/AST.cpp
parent38be56407b64b81cf7ff0674e1192c8cef614c48 (diff)
downloadqt-creator-03854281da39790878062c00eb46b03c9b5beeb1.tar.gz
Accept the next-declarator in NewDeclaratorAST::accept() and implemented NewDeclarator::lastToken().
Diffstat (limited to 'shared/cplusplus/AST.cpp')
-rw-r--r--shared/cplusplus/AST.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp
index ff19e4439b..cf37e5cb59 100644
--- a/shared/cplusplus/AST.cpp
+++ b/shared/cplusplus/AST.cpp
@@ -1821,9 +1821,11 @@ void NewDeclaratorAST::accept0(ASTVisitor *visitor)
{
if (visitor->visit(this)) {
for (PtrOperatorAST *ptr_op = ptr_operators; ptr_op;
- ptr_op = static_cast<PtrOperatorAST *>(ptr_op->next))
+ ptr_op = static_cast<PtrOperatorAST *>(ptr_op->next)) {
accept(ptr_op, visitor);
- // ### TODO accept the brackets
+ }
+
+ accept(declarator, visitor);
}
}
@@ -1834,10 +1836,14 @@ unsigned NewDeclaratorAST::firstToken() const
unsigned NewDeclaratorAST::lastToken() const
{
- assert(0 && "review me");
if (declarator)
return declarator->lastToken();
- assert(0); // ### implement me
+
+ for (PtrOperatorAST *it = ptr_operators; it; it = it->next) {
+ if (! it->next)
+ return it->lastToken();
+ }
+
return 0;
}