summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/moc.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2010-07-22 11:27:57 (GMT)
committerMartin Smith <martin.smith@nokia.com>2010-07-22 11:27:57 (GMT)
commitcf1f76661613313615a77479687fa93a3c97efc9 (patch)
tree978b8d1117224773952d1d2782d7825920bfc6ed /src/tools/moc/moc.cpp
parentd8908922f339892fee4275a433e2bf6da87ae055 (diff)
parentbe227b0a01bb28f3ebebedc1aaa65cd8098edd81 (diff)
downloadQt-cf1f76661613313615a77479687fa93a3c97efc9.zip
Qt-cf1f76661613313615a77479687fa93a3c97efc9.tar.gz
Qt-cf1f76661613313615a77479687fa93a3c97efc9.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src/tools/moc/moc.cpp')
-rw-r--r--src/tools/moc/moc.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 10a80f3..84d1567 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -1208,6 +1208,12 @@ bool Moc::until(Token target) {
default: break;
}
}
+
+ //when searching commas within the default argument, we should take care of template depth (anglecount)
+ // unfortunatelly, we do not have enough semantic information to know if '<' is the operator< or
+ // the begining of a template type. so we just use heuristics.
+ int possible = -1;
+
while (index < symbols.size()) {
Token t = symbols.at(index++).token;
switch (t) {
@@ -1226,8 +1232,16 @@ bool Moc::until(Token target) {
&& braceCount <= 0
&& brackCount <= 0
&& parenCount <= 0
- && (target != RANGLE || angleCount <= 0))
+ && (target != RANGLE || angleCount <= 0)) {
+ if (target != COMMA || angleCount <= 0)
+ return true;
+ possible = index;
+ }
+
+ if (target == COMMA && t == EQ && possible != -1) {
+ index = possible;
return true;
+ }
if (braceCount < 0 || brackCount < 0 || parenCount < 0
|| (target == RANGLE && angleCount < 0)) {
@@ -1235,6 +1249,12 @@ bool Moc::until(Token target) {
break;
}
}
+
+ if(target == COMMA && angleCount != 0 && possible != -1) {
+ index = possible;
+ return true;
+ }
+
return false;
}