diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-11-10 14:56:37 +0100 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-11-10 16:20:12 +0100 |
commit | b47eee88695ab5ea499a0197a779e37ad745fd5d (patch) | |
tree | 3766b91aece0859b1514066c1e11a8b0c9cbcbd5 /src/shared/cplusplus/Parser.cpp | |
parent | 24b6c858ebc3a16e9a82c0ea6e8fc6743f0e3229 (diff) | |
download | qt-creator-b47eee88695ab5ea499a0197a779e37ad745fd5d.tar.gz |
Cleanup Attributes
Diffstat (limited to 'src/shared/cplusplus/Parser.cpp')
-rw-r--r-- | src/shared/cplusplus/Parser.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp index c74b3ca960..d9b3635e4b 100644 --- a/src/shared/cplusplus/Parser.cpp +++ b/src/shared/cplusplus/Parser.cpp @@ -2689,32 +2689,24 @@ bool Parser::parseAttributeSpecifier(SpecifierAST *&node) return true; } -bool Parser::parseAttributeList(AttributeAST *&node) +bool Parser::parseAttributeList(AttributeListAST *&node) // ### create the AST { DEBUG_THIS_RULE(); - AttributeAST **attribute_ptr = &node; - while (LA() == T_IDENTIFIER || LA() == T_CONST) { - AttributeAST *ast = new (_pool) AttributeAST; - ast->identifier_token = consumeToken(); - if (LA() == T_LPAREN) { - ast->lparen_token = consumeToken(); - if (LA() == T_IDENTIFIER && (LA(2) == T_COMMA || LA(2) == T_RPAREN)) { - ast->tag_token = consumeToken(); - if (LA() == T_COMMA) - parseExpressionList(ast->expression_list); - } else { - parseExpressionList(ast->expression_list); - } - match(T_RPAREN, &ast->rparen_token); + + while (LA() == T_CONST || LA() == T_IDENTIFIER) { + if (LA() == T_CONST) + consumeToken(); + else if (LA() == T_IDENTIFIER) { + ExpressionAST *expression = 0; + parseExpression(expression); } - *attribute_ptr = ast; if (LA() != T_COMMA) break; - consumeToken(); - attribute_ptr = &(*attribute_ptr)->next; + consumeToken(); // skip T_COMMA } + return true; } |