summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-02-24 11:38:56 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-02-24 11:46:41 (GMT)
commitf57dac1faf4d39eae851d0e9238a8b5968b48a73 (patch)
tree9bb4982a412e48f823c64708b3ceb311ff9bae62 /src
parent62d78d36c49a3e108bd24ef831d76ff2c4a9ba65 (diff)
downloadQt-f57dac1faf4d39eae851d0e9238a8b5968b48a73.zip
Qt-f57dac1faf4d39eae851d0e9238a8b5968b48a73.tar.gz
Qt-f57dac1faf4d39eae851d0e9238a8b5968b48a73.tar.bz2
Fix Q_INVOKABLE declared after Q_PROPERTY
moc was starting to parse function one token too late. This was usually unnoticed because there is usually a semi colon, or a colon, or some other token that are ignored. But in this case, a Q_PROPERTY is not ignored, the parsing would fail. Reviewed-by: brad
Diffstat (limited to 'src')
-rw-r--r--src/tools/moc/moc.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index f72bdf5..5e8b2b8 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -668,10 +668,13 @@ void Moc::parse()
if (parseEnum(&enumDef))
def.enumList += enumDef;
} break;
+ case SEMIC:
+ case COLON:
+ break;
default:
FunctionDef funcDef;
funcDef.access = access;
- int rewind = index;
+ int rewind = index--;
if (parseMaybeFunction(&def, &funcDef)) {
if (funcDef.isConstructor) {
if ((access == FunctionDef::Public) && funcDef.isInvokable) {