diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-26 12:23:57 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-26 12:23:57 +0200 |
commit | 5c7909681b30dbe860ecd41901c84f17f6c6aa21 (patch) | |
tree | 4c3b86e38a0d8ba3adac828b8ff36efa99d5a01f /src/shared/cplusplus | |
parent | 988cc958ab78cf9debeaef3e93c0007519dc2289 (diff) | |
download | qt-creator-5c7909681b30dbe860ecd41901c84f17f6c6aa21.tar.gz |
Get rid of the old Parser::parseExpressionOrDeclarationStatement().
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r-- | src/shared/cplusplus/Parser.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp index 4a7dbd62f0..4e2b7cde60 100644 --- a/src/shared/cplusplus/Parser.cpp +++ b/src/shared/cplusplus/Parser.cpp @@ -2900,7 +2900,6 @@ bool Parser::maybeAmbiguousStatement(DeclarationStatementAST *ast, StatementAST return maybeAmbiguous; } -#if 1 bool Parser::parseExpressionOrDeclarationStatement(StatementAST *&node) { DEBUG_THIS_RULE(); @@ -2976,38 +2975,6 @@ bool Parser::parseExpressionOrDeclarationStatement(StatementAST *&node) rewind(start); return parseExpressionStatement(node); } -#else -bool Parser::parseExpressionOrDeclarationStatement(StatementAST *&node) -{ - DEBUG_THIS_RULE(); - if (LA() == T_SEMICOLON) - return parseExpressionStatement(node); - - const unsigned start = cursor(); - const bool startsWithName = LA() == T_COLON_COLON || LA() == T_IDENTIFIER; - - - if (! parseDeclarationStatement(node)) { - rewind(start); - return parseExpressionStatement(node); - } - - if (startsWithName) { - if (DeclarationStatementAST *as_declaration = node->asDeclarationStatement()) { - StatementAST *as_expression = 0; - if (maybeAmbiguousStatement(as_declaration, as_expression)) { - // it's an ambiguous expression-or-declaration statement. - ExpressionOrDeclarationStatementAST *ast = new (_pool) ExpressionOrDeclarationStatementAST; - ast->declaration = as_declaration; - ast->expression = as_expression; - node = ast; - } - } - } - - return true; -} -#endif bool Parser::parseCondition(ExpressionAST *&node) { |