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

Unified Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 2930453002: update analyzer parser tests for fasta scanner (Closed)
Patch Set: add docs for the === token Created 3 years, 6 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 | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)) {
_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);
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698