summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/AST.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-11-10 11:13:57 +0100
committerRoberto Raggi <roberto.raggi@nokia.com>2009-11-10 16:20:09 +0100
commit4089c906fa0fb2988e73c23d8eeb5a15d8b8629f (patch)
tree2cc2b2f71367c3ff755082141647915538a773f7 /src/shared/cplusplus/AST.cpp
parent9e7ff0469b134d4ab4224fa3134beffae8ddf656 (diff)
downloadqt-creator-4089c906fa0fb2988e73c23d8eeb5a15d8b8629f.tar.gz
Removed the ExpressionListAST node.
Done with Erik Verbruggen
Diffstat (limited to 'src/shared/cplusplus/AST.cpp')
-rw-r--r--src/shared/cplusplus/AST.cpp58
1 files changed, 15 insertions, 43 deletions
diff --git a/src/shared/cplusplus/AST.cpp b/src/shared/cplusplus/AST.cpp
index babf8380c5..18357aee9d 100644
--- a/src/shared/cplusplus/AST.cpp
+++ b/src/shared/cplusplus/AST.cpp
@@ -100,10 +100,9 @@ unsigned AttributeAST::lastToken() const
if (rparen_token)
return rparen_token + 1;
- for (ExpressionListAST *it = expression_list;
- it->expression && it->next; it = it->next) {
- if (! it->next && it->expression) {
- return it->expression->lastToken();
+ for (ExpressionListAST *it = expression_list; it->value && it->next; it = it->next) {
+ if (! it->next && it->value) {
+ return it->value->lastToken();
}
}
@@ -174,8 +173,8 @@ unsigned ArrayInitializerAST::lastToken() const
return rbrace_token + 1;
for (ExpressionListAST *it = expression_list; it; it = it->next) {
- if (! it->next && it->expression)
- return it->expression->lastToken();
+ if (! it->next && it->value)
+ return it->value->lastToken();
}
return lbrace_token + 1;
@@ -304,8 +303,8 @@ unsigned CallAST::lastToken() const
if (rparen_token)
return rparen_token + 1;
for (ExpressionListAST *it = expression_list; it; it = it->next) {
- if (! it->next && it->expression)
- return it->expression->lastToken();
+ if (! it->next && it->value)
+ return it->value->lastToken();
}
return lparen_token + 1;
}
@@ -643,9 +642,6 @@ unsigned DeclaratorIdAST::lastToken() const
unsigned DeclaratorListAST::firstToken() const
{
- if (comma_token)
- return comma_token;
-
return declarator->firstToken();
}
@@ -655,8 +651,6 @@ unsigned DeclaratorListAST::lastToken() const
if (! it->next) {
if (it->declarator)
return it->declarator->lastToken();
- else if (it->comma_token)
- return it->comma_token + 1;
}
}
@@ -818,8 +812,8 @@ unsigned ExceptionSpecificationAST::lastToken() const
return rparen_token + 1;
for (ExpressionListAST *it = type_ids; it; it = it->next) {
- if (! it->next && it->expression)
- return it->expression->lastToken();
+ if (! it->next && it->value)
+ return it->value->lastToken();
}
if (dot_dot_dot_token)
@@ -830,22 +824,6 @@ unsigned ExceptionSpecificationAST::lastToken() const
return throw_token + 1;
}
-
-unsigned ExpressionListAST::firstToken() const
-{
- return expression->firstToken();
-}
-
-unsigned ExpressionListAST::lastToken() const
-{
- for (const ExpressionListAST *it = this; it; it = it->next) {
- if (! it->next)
- return it->expression->lastToken();
- }
- return 0;
-}
-
-
unsigned ExpressionOrDeclarationStatementAST::firstToken() const
{
return declaration->firstToken();
@@ -1908,8 +1886,8 @@ unsigned IdentifierListAST::firstToken() const
{
if (name)
return name->firstToken();
- else
- return comma_token;
+ // ### assert?
+ return 0;
}
unsigned IdentifierListAST::lastToken() const
@@ -2264,8 +2242,6 @@ unsigned ObjCPropertyAttributeListAST::firstToken() const
{
if (attr)
return attr->firstToken();
- else if (comma_token)
- return comma_token;
else if (next)
return next->lastToken();
else
@@ -2276,12 +2252,8 @@ unsigned ObjCPropertyAttributeListAST::firstToken() const
unsigned ObjCPropertyAttributeListAST::lastToken() const
{
for (const ObjCPropertyAttributeListAST *it = this; it; it = it->next) {
- if (! it->next && (comma_token || it->attr)) {
- if (comma_token)
- return comma_token + 1;
- else
- return it->attr->lastToken();
- }
+ if (! it->next && it->attr)
+ return it->attr->lastToken();
}
// ### assert?
return 0;
@@ -2407,8 +2379,8 @@ unsigned ObjCSynthesizedPropertyListAST::firstToken() const
{
if (synthesized_property)
return synthesized_property->firstToken();
- else
- return comma_token;
+ // ### assert?
+ return 0;
}
unsigned ObjCSynthesizedPropertyListAST::lastToken() const