Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
b2df9bdd
Commit
b2df9bdd
authored
Jul 03, 2009
by
Roberto Raggi
Browse files
Made foreach a keyword when parsing with qtMocRun
parent
3cdd4806
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/pp-engine.cpp
View file @
b2df9bdd
...
...
@@ -1435,6 +1435,8 @@ bool Preprocessor::isQtReservedWord(const QByteArray ¯oId) const
return
true
;
else
if
(
size
==
7
&&
macroId
.
at
(
0
)
==
's'
&&
macroId
==
"signals"
)
return
true
;
else
if
(
size
==
7
&&
macroId
.
at
(
0
)
==
'f'
&&
macroId
==
"foreach"
)
return
true
;
else
if
(
size
==
5
&&
macroId
.
at
(
0
)
==
's'
&&
macroId
==
"slots"
)
return
true
;
return
false
;
...
...
src/shared/cplusplus/Keywords.cpp
View file @
b2df9bdd
...
...
@@ -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'
)
{
...
...
src/shared/cplusplus/Token.cpp
View file @
b2df9bdd
...
...
@@ -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
()
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment