Chromium Code Reviews| 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(); |
| } |