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

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

Issue 2981343002: improve fasta closing brace recovery (Closed)
Patch Set: rebase Created 3 years, 5 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 9053bb0463cc7ff2c731d2a2f2c579b3cdac5eca..a18a016b41fb8399164cce1841d1d118501b2787 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -6911,6 +6911,12 @@ class Parser {
['}', ']']);
rightCurlyBracket = rightSquareBracket;
rightSquareBracket = null;
+ // Skip over synthetic closer inserted by fasta
+ // since we've already reported an error
+ if (_currentToken.type == TokenType.CLOSE_CURLY_BRACKET &&
+ _currentToken.isSynthetic) {
+ _advance();
+ }
} else {
_reportErrorForCurrentToken(
ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP,
@@ -6927,6 +6933,12 @@ class Parser {
[']', '}']);
rightSquareBracket = rightCurlyBracket;
rightCurlyBracket = null;
+ // Skip over synthetic closer inserted by fasta
+ // since we've already reported an error
+ if (_currentToken.type == TokenType.CLOSE_SQUARE_BRACKET &&
+ _currentToken.isSynthetic) {
+ _advance();
+ }
} else {
_reportErrorForCurrentToken(
ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP,
« 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