diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-07-03 09:11:52 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-07-03 09:12:58 +0200 |
commit | 3cdd48067c8c865d050a19766948d05c86ec6e40 (patch) | |
tree | 339702b3a68d8703f87ab01b79cfb5f4894eb54c /src/shared/cplusplus/AST.cpp | |
parent | 16286b763d74b5793cf1b564252510d4a43ad71f (diff) | |
download | qt-creator-3cdd48067c8c865d050a19766948d05c86ec6e40.tar.gz |
Introduced ForeachStatementAST and the bits to parse foreach statements when qtMocRun is enabled.
Diffstat (limited to 'src/shared/cplusplus/AST.cpp')
-rw-r--r-- | src/shared/cplusplus/AST.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/shared/cplusplus/AST.cpp b/src/shared/cplusplus/AST.cpp index c809f6e1d0..dc6a505677 100644 --- a/src/shared/cplusplus/AST.cpp +++ b/src/shared/cplusplus/AST.cpp @@ -874,6 +874,24 @@ unsigned ExpressionStatementAST::lastToken() const return 0; } +unsigned ForeachStatementAST::firstToken() const +{ + return foreach_token; +} + +unsigned ForeachStatementAST::lastToken() const +{ + if (statement) + return statement->lastToken(); + else if (rparen_token) + return rparen_token + 1; + else if (expression) + return expression->lastToken(); + else if (comma_token) + return comma_token + 1; + + return foreach_token + 1; +} unsigned ForStatementAST::firstToken() const { |