Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java

Issue 268673006: Fix for 10469- removal of the ArgumentDefinitionTest Ast node from the analyzer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase before commit Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
index 8f301fa59e9743cd7c88bbf4e17e62cc982b8c4c..150368cf910a219407848063fedb29e268ba5ea9 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
@@ -2345,23 +2345,6 @@ public class Parser {
}
/**
- * Parse an argument definition test.
- *
- * <pre>
- * argumentDefinitionTest ::=
- * '?' identifier
- * </pre>
- *
- * @return the argument definition test that was parsed
- */
- private ArgumentDefinitionTest parseArgumentDefinitionTest() {
- Token question = expect(TokenType.QUESTION);
- SimpleIdentifier identifier = parseSimpleIdentifier();
- reportErrorForToken(ParserErrorCode.DEPRECATED_ARGUMENT_DEFINITION_TEST, question);
- return new ArgumentDefinitionTest(question, identifier);
- }
-
- /**
* Parse an assert statement.
*
* <pre>
@@ -5109,8 +5092,10 @@ public class Parser {
}
} else if (matches(TokenType.LT)) {
return parseListOrMapLiteral(null);
- } else if (matches(TokenType.QUESTION)) {
- return parseArgumentDefinitionTest();
+ } else if (matches(TokenType.QUESTION) && tokenMatches(peek(), TokenType.IDENTIFIER)) {
+ reportErrorForCurrentToken(ParserErrorCode.UNEXPECTED_TOKEN, currentToken.getLexeme());
+ advance();
+ return parsePrimaryExpression();
} else if (matchesKeyword(Keyword.VOID)) {
//
// Recover from having a return type of "void" where a return type is not expected.

Powered by Google App Engine
This is Rietveld 408576698