From 5c7909681b30dbe860ecd41901c84f17f6c6aa21 Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Thu, 26 Aug 2010 12:23:57 +0200
Subject: [PATCH] Get rid of the old
 Parser::parseExpressionOrDeclarationStatement().

---
 src/shared/cplusplus/Parser.cpp | 33 ---------------------------------
 1 file changed, 33 deletions(-)

diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp
index 4a7dbd62f00..4e2b7cde60a 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)
 {
-- 
GitLab