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

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

Issue 10928109: Unbreak the parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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/parser.dart
diff --git a/dart/lib/compiler/implementation/scanner/parser.dart b/dart/lib/compiler/implementation/scanner/parser.dart
index 695332e50c669095db0ea4fefdd59a71a9273d63..1f5fc0853d9ba0f5b3f726d48c650dab61ad7467 100644
--- a/dart/lib/compiler/implementation/scanner/parser.dart
+++ b/dart/lib/compiler/implementation/scanner/parser.dart
@@ -264,8 +264,12 @@ class Parser {
return listener.expectedBlockToSkip(token);
}
BeginGroupToken beginGroupToken = token;
- assert(beginGroupToken.endGroup === null ||
- beginGroupToken.endGroup.kind === $CLOSE_CURLY_BRACKET);
+ Token endGroup = beginGroupToken.endGroup;
+ if (endGroup === null) {
+ return listener.unmatched(beginGroupToken);
+ } else if (endGroup.kind !== $CLOSE_CURLY_BRACKET) {
+ return listener.unmatched(beginGroupToken);
+ }
return beginGroupToken.endGroup;
}
« no previous file with comments | « dart/lib/compiler/implementation/scanner/listener.dart ('k') | dart/lib/compiler/implementation/scanner/partial_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698