Chromium Code Reviews| Index: pkg/analyzer/lib/src/generated/parser.dart |
| diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart |
| index 92b5d0ea179525758bf4e485afcdb9bb9cc7b4d8..e7187a2463d8a603b8a54dbe5c3b255604f99916 100644 |
| --- a/pkg/analyzer/lib/src/generated/parser.dart |
| +++ b/pkg/analyzer/lib/src/generated/parser.dart |
| @@ -1275,7 +1275,8 @@ class Parser { |
| _validateModifiersForGetterOrSetterOrMethod(modifiers); |
| return parseSetter(commentAndMetadata, modifiers.externalKeyword, |
| modifiers.staticKeyword, returnType); |
| - } else if (keyword == Keyword.OPERATOR && _isOperator(next)) { |
| + } else if (keyword == Keyword.OPERATOR && |
| + (_isOperator(next) || next.type == TokenType.EQ_EQ_EQ)) { |
|
Brian Wilkerson
2017/06/06 14:00:17
What is "==="?
That operator hasn't been part of
danrubel
2017/06/07 15:03:46
Good question. It exists for the purpose of better
|
| _validateModifiersForOperator(modifiers); |
| return _parseOperatorAfterKeyword(commentAndMetadata, |
| modifiers.externalKeyword, returnType, getAndAdvance()); |
| @@ -7209,7 +7210,10 @@ class Parser { |
| Token operatorKeyword) { |
| if (!_currentToken.isUserDefinableOperator) { |
| _reportErrorForCurrentToken( |
| - ParserErrorCode.NON_USER_DEFINABLE_OPERATOR, [_currentToken.lexeme]); |
| + _currentToken.type == TokenType.EQ_EQ_EQ |
| + ? ParserErrorCode.INVALID_OPERATOR |
| + : ParserErrorCode.NON_USER_DEFINABLE_OPERATOR, |
| + [_currentToken.lexeme]); |
| } |
| SimpleIdentifier name = |
| astFactory.simpleIdentifier(getAndAdvance(), isDeclaration: true); |