From cefdb3da30e3d3994fbd7ba3410ee8616db282d3 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen <erik.verbruggen@nokia.com> Date: Wed, 3 Mar 2010 16:45:18 +0100 Subject: [PATCH] Fixed parsing of properties whose name is a C++ keyword. Reviewed-by: Roberto Raggi --- src/shared/cplusplus/Parser.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp index a7a70a45348..d77d2b3314f 100644 --- a/src/shared/cplusplus/Parser.cpp +++ b/src/shared/cplusplus/Parser.cpp @@ -1792,8 +1792,15 @@ bool Parser::parseQtPropertyDeclaration(DeclarationAST *&node) if (LA() == T_LPAREN) { ast->lparen_token = consumeToken(); parseTypeId(ast->type_id); + SimpleNameAST *property_name = new (_pool) SimpleNameAST; - match(T_IDENTIFIER, &property_name->identifier_token); + // special case: keywords are allowed for property names! + if (tok().isKeyword()) { + property_name->identifier_token = consumeToken(); + } else { + match(T_IDENTIFIER, &property_name->identifier_token); + } + ast->property_name = property_name; QtPropertyDeclarationItemListAST **iter = &ast->property_declaration_items; while (true) { -- GitLab