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

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

Issue 11092101: Diagnose unbalanced parentheses better. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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
Index: dart/lib/compiler/implementation/scanner/listener.dart
diff --git a/dart/lib/compiler/implementation/scanner/listener.dart b/dart/lib/compiler/implementation/scanner/listener.dart
index 86d088ccf046b8528bc26ee08fb12eecf63370b6..99dd78db6c456972ed6f16c9c52473a8613647ea 100644
--- a/dart/lib/compiler/implementation/scanner/listener.dart
+++ b/dart/lib/compiler/implementation/scanner/listener.dart
@@ -938,7 +938,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