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

Unified Diff: pkg/compiler/lib/src/parser/parser.dart

Issue 1943723003: Report UNMATCHED_TOKEN instead of EXTRANEOUS_MODIFIER (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add test from bug report Created 4 years, 8 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 | tests/compiler/dart2js/error_token_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/parser/parser.dart
diff --git a/pkg/compiler/lib/src/parser/parser.dart b/pkg/compiler/lib/src/parser/parser.dart
index 821fcad03d8d64496ba4c78f3bc4c16fab8fa862..285a4197719d801a445297fdd0968a163daea373 100644
--- a/pkg/compiler/lib/src/parser/parser.dart
+++ b/pkg/compiler/lib/src/parser/parser.dart
@@ -28,6 +28,7 @@ import '../tokens/precedence_constants.dart'
import '../tokens/token.dart'
show
BeginGroupToken,
+ ErrorToken,
isUserDefinableOperator,
KeywordToken,
SymbolToken,
@@ -1000,7 +1001,11 @@ class Parser {
? MessageKind.EXTRANEOUS_MODIFIER
: MessageKind.EXTRANEOUS_MODIFIER_REPLACE;
for (Token modifier in modifierList) {
- listener.reportError(modifier, kind, {'modifier': modifier});
+ if (modifier is ErrorToken) {
ahe 2016/05/03 11:11:38 Modify Listenener.reportError instead.
Johnni Winther 2016/05/04 08:07:31 Done.
+ listener.reportErrorToken(modifier);
+ } else {
+ listener.reportError(modifier, kind, {'modifier': modifier});
+ }
}
return null;
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/error_token_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698