aboutsummaryrefslogtreecommitdiffstats
path: root/generator/parser/parser.cpp
diff options
context:
space:
mode:
authorBart Vanhauwaert <bart.vanhauwaert@grafitroniks.fr>2016-11-22 10:19:40 +0100
committerBart Vanhauwaert <bart.vanhauwaert@grafitroniks.fr>2016-11-23 11:40:19 +0100
commit07b0807cc47b41e3ce44b29fa31989849311c640 (patch)
tree363ee0be34174a0ed9fad358364a00d94166648b /generator/parser/parser.cpp
parentAdd QFileDevice for closing QFiles (diff)
downloadqtscriptgenerator-07b0807cc47b41e3ce44b29fa31989849311c640.tar.xz
qtscriptgenerator-07b0807cc47b41e3ce44b29fa31989849311c640.zip
Parse new Q_ENUM Qt macro introduced with Qt 5.5.
We do the same thing as moc and just treat it as a Q_ENUMS(...) macro since Q_ENUM's syntactic use should be a strict subset of Q_ENUMS'
Diffstat (limited to 'generator/parser/parser.cpp')
-rw-r--r--generator/parser/parser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/generator/parser/parser.cpp b/generator/parser/parser.cpp
index 15edc7b..a8692e9 100644
--- a/generator/parser/parser.cpp
+++ b/generator/parser/parser.cpp
@@ -460,6 +460,7 @@ bool Parser::parseDeclaration(DeclarationAST *&node)
case Token_asm:
return parseAsmDefinition(node);
+ case Token_Q_ENUM:
case Token_Q_ENUMS:
return parseQ_ENUMS(node);
@@ -4375,7 +4376,7 @@ bool Parser::parseThrowExpression(ExpressionAST *&node)
bool Parser::parseQ_ENUMS(DeclarationAST *&node)
{
- if (token_stream.lookAhead() != Token_Q_ENUMS)
+ if (token_stream.lookAhead() != Token_Q_ENUMS && token_stream.lookAhead() != Token_Q_ENUM)
return false;
if (token_stream.lookAhead(1) != '(')