Commit b1af22b3 authored by Erik Verbruggen's avatar Erik Verbruggen

Fixed error recovery when failing to parse Q_PROPERTY.

parent 28d72550
......@@ -1822,11 +1822,12 @@ bool Parser::parseQtPropertyDeclaration(DeclarationAST *&node)
QtPropertyDeclarationBoolItemAST *bItem = new (_pool) QtPropertyDeclarationBoolItemAST;
bItem->item_name_token = consumeToken();
ExpressionAST *expr = 0;
if (parseBoolLiteral(expr))
if (parseBoolLiteral(expr)) {
bItem->bool_value = expr->asBoolLiteral();
else
item = bItem;
} else {
_translationUnit->error(cursor(), "expected `true' or `false' before `%s'", tok().spell());
item = bItem;
}
break;
}
......@@ -1840,16 +1841,20 @@ bool Parser::parseQtPropertyDeclaration(DeclarationAST *&node)
default:
_translationUnit->error(cursor(), "expected `)' before `%s'", tok().spell());
return true;
// skip the token
consumeToken();
}
if (item) {
*iter = new (_pool) QtPropertyDeclarationItemListAST;
(*iter)->value = item;
iter = &(*iter)->next;
}
} else if (!LA()) {
break;
} else {
_translationUnit->error(cursor(), "expected `)' before `%s'", tok().spell());
break;
// skip the token
consumeToken();
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment