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

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

Issue 15260002: Report ParserErrorCode.MISSING_IDENTIFIER (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments Created 7 years, 7 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
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/ErrorParserTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f67fdc8fe11d9fbb23fafd807316af770de20b28..d99573bd1b6b22c44d46e6f353846182d62993ff 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
@@ -3823,12 +3823,23 @@ public class Parser {
Expression expression;
if (matches(Keyword.SUPER) && currentToken.getNext().getType().isMultiplicativeOperator()) {
expression = new SuperExpression(getAndAdvance());
+ } else if (currentToken.getType() == TokenType.PLUS
Brian Wilkerson 2013/05/17 20:54:58 It seems like we ought to be able to use the code
+ || currentToken.getType().isMultiplicativeOperator()) {
+ reportError(ParserErrorCode.MISSING_IDENTIFIER);
+ expression = createSyntheticIdentifier();
} else {
expression = parseUnaryExpression();
}
while (currentToken.getType().isMultiplicativeOperator()) {
Token operator = getAndAdvance();
- expression = new BinaryExpression(expression, operator, parseUnaryExpression());
+ Expression nextExpression;
+ if (currentToken.getType() == TokenType.PLUS) {
+ reportError(ParserErrorCode.MISSING_IDENTIFIER);
+ nextExpression = createSyntheticIdentifier();
+ } else {
+ nextExpression = parseUnaryExpression();
+ }
+ expression = new BinaryExpression(expression, operator, nextExpression);
}
return expression;
}
@@ -4351,6 +4362,7 @@ public class Parser {
advance();
return parsePrimaryExpression();
} else {
+ reportError(ParserErrorCode.MISSING_IDENTIFIER);
return createSyntheticIdentifier();
}
}
@@ -5115,6 +5127,7 @@ public class Parser {
return new PrefixExpression(operator, parseAssignableExpression(false));
} else if (matches(TokenType.PLUS)) {
reportError(ParserErrorCode.USE_OF_UNARY_PLUS_OPERATOR);
+ advance();
}
return parsePostfixExpression();
}
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/ErrorParserTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698