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

Unified Diff: dart/lib/compiler/implementation/scanner/token.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
« no previous file with comments | « dart/lib/compiler/implementation/scanner/string_scanner.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/scanner/token.dart
diff --git a/dart/lib/compiler/implementation/scanner/token.dart b/dart/lib/compiler/implementation/scanner/token.dart
index 5a09c191ca5e3bc43ea5625c42d281b38d94d3b4..3848c070fe96f79d8e87e22ae17545ef1d0ddf33 100644
--- a/dart/lib/compiler/implementation/scanner/token.dart
+++ b/dart/lib/compiler/implementation/scanner/token.dart
@@ -139,7 +139,13 @@ class Token implements Spannable {
/**
* The number of characters parsed by this token.
*/
- int get slowCharCount => slowToString().length;
+ int get slowCharCount {
+ if (info == BAD_INPUT_INFO) {
floitsch 2012/10/12 12:23:28 add comment why this is 1.
+ return 1;
+ } else {
+ return slowToString().length;
+ }
+ }
}
/**
« no previous file with comments | « dart/lib/compiler/implementation/scanner/string_scanner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698