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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart

Issue 11092101: Diagnose unbalanced parentheses better. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years, 1 month 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
Index: dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart b/dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
index e8a15aa55ec01b7b5cc34e3ef5487a1c173f47f6..4e568e79ac5c427afba75a40465cfa7a3b61808c 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
@@ -947,7 +947,11 @@ class ElementListener extends Listener {
}
Token unexpected(Token token) {
- listener.cancel("unexpected token '${token.slowToString()}'", token: token);
+ String message = "unexpected token '${token.slowToString()}'";
+ if (token.info == BAD_INPUT_INFO) {
+ message = token.stringValue;
+ }
+ listener.cancel(message, token: token);
return skipToEof(token);
}

Powered by Google App Engine
This is Rietveld 408576698