| Index: sdk/lib/_internal/compiler/implementation/scanner/parser.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/scanner/parser.dart b/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
|
| index 63e7da7a422e1244f7b3bbb062c99615361ba082..05b1acfe4e85acc588c1dbb7655338612e280638 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
|
| @@ -1581,6 +1581,12 @@ class Parser {
|
| }
|
| info = token.info;
|
| tokenLevel = info.precedence;
|
| + if (level == EQUALITY_PRECEDENCE || level == RELATIONAL_PRECEDENCE) {
|
| + // We don't allow (a == b == c) or (a < b < c).
|
| + // Continue the outer loop if we have matched one equality or
|
| + // relational operator.
|
| + break;
|
| + }
|
| }
|
| }
|
| return token;
|
| @@ -1623,23 +1629,8 @@ class Parser {
|
| String value = token.stringValue;
|
| // Prefix:
|
| if (identical(value, '+')) {
|
| - // Dart only allows "prefix plus" as an initial part of a
|
| - // decimal literal. We scan it as a separate token and let
|
| - // the parser listener combine it with the digits.
|
| - Token next = token.next;
|
| - if (identical(next.charOffset, token.charOffset + 1)) {
|
| - if (identical(next.kind, INT_TOKEN)) {
|
| - listener.handleLiteralInt(token);
|
| - return next.next;
|
| - }
|
| - if (identical(next.kind, DOUBLE_TOKEN)) {
|
| - listener.handleLiteralDouble(token);
|
| - return next.next;
|
| - }
|
| - }
|
| - listener.recoverableError("Unexpected token '+'", token: token);
|
| - return parsePrecedenceExpression(next, POSTFIX_PRECEDENCE,
|
| - allowCascades);
|
| + // Dart no longer allows prefix-plus.
|
| + listener.reportError(token, MessageKind.UNSUPPORTED_PREFIX_PLUS);
|
| } else if ((identical(value, '!')) ||
|
| (identical(value, '-')) ||
|
| (identical(value, '~'))) {
|
|
|