summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-07-03 11:00:36 +0200
committerRoberto Raggi <roberto.raggi@nokia.com>2009-07-03 11:00:36 +0200
commitb2df9bddec0b11180f196abb1485a1ca913591c7 (patch)
treecb2e37fcb5ffbbb016a00d9af0e2d291d9443377 /src/shared/cplusplus
parent3cdd48067c8c865d050a19766948d05c86ec6e40 (diff)
downloadqt-creator-b2df9bddec0b11180f196abb1485a1ca913591c7.tar.gz
Made foreach a keyword when parsing with qtMocRun
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r--src/shared/cplusplus/Keywords.cpp15
-rw-r--r--src/shared/cplusplus/Token.cpp2
2 files changed, 16 insertions, 1 deletions
diff --git a/src/shared/cplusplus/Keywords.cpp b/src/shared/cplusplus/Keywords.cpp
index e26244a0af..3d8fc434f5 100644
--- a/src/shared/cplusplus/Keywords.cpp
+++ b/src/shared/cplusplus/Keywords.cpp
@@ -620,6 +620,21 @@ static inline int classify7(const char *s, bool q) {
}
}
}
+ else if (q && s[0] == 'f') {
+ if (s[1] == 'o') {
+ if (s[2] == 'r') {
+ if (s[3] == 'e') {
+ if (s[4] == 'a') {
+ if (s[5] == 'c') {
+ if (s[6] == 'h') {
+ return T_Q_FOREACH;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
else if (q && s[0] == 's') {
if (s[1] == 'i') {
if (s[2] == 'g') {
diff --git a/src/shared/cplusplus/Token.cpp b/src/shared/cplusplus/Token.cpp
index 6e5e428c2d..37a95d6cd7 100644
--- a/src/shared/cplusplus/Token.cpp
+++ b/src/shared/cplusplus/Token.cpp
@@ -90,7 +90,7 @@ static const char *token_names[] = {
("@protected"), ("@protocol"), ("@public"), ("@required"), ("@selector"),
("@synchronized"), ("@synthesize"), ("@throw"), ("@try"),
- ("SIGNAL"), ("SLOT"), ("Q_SIGNAL"), ("Q_SLOT"), ("signals"), ("slots")
+ ("SIGNAL"), ("SLOT"), ("Q_SIGNAL"), ("Q_SLOT"), ("signals"), ("slots"), ("Q_FOREACH")
};
Token::Token() :