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

Unified Diff: dart/lib/compiler/implementation/scanner/partial_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
« no previous file with comments | « dart/lib/compiler/implementation/scanner/parser.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/partial_parser.dart
diff --git a/dart/lib/compiler/implementation/scanner/partial_parser.dart b/dart/lib/compiler/implementation/scanner/partial_parser.dart
index 65bc5614400e89ff4e1434bf2d935a415ea17774..bbdaca8421f8a71d7210d7f5e452989bce731c94 100644
--- a/dart/lib/compiler/implementation/scanner/partial_parser.dart
+++ b/dart/lib/compiler/implementation/scanner/partial_parser.dart
@@ -80,9 +80,13 @@ class PartialParser extends Parser {
return listener.expectedClassBodyToSkip(token);
}
BeginGroupToken beginGroupToken = token;
- assert(beginGroupToken.endGroup === null ||
- beginGroupToken.endGroup.kind === $CLOSE_CURLY_BRACKET);
- return beginGroupToken.endGroup;
+ Token endGroup = beginGroupToken.endGroup;
+ if (endGroup === null) {
+ return listener.unmatched(beginGroupToken);
+ } else if (endGroup.kind !== $CLOSE_CURLY_BRACKET) {
+ return listener.unmatched(beginGroupToken);
+ }
+ return endGroup;
}
Token parseFunctionBody(Token token, bool isExpression) {
« no previous file with comments | « dart/lib/compiler/implementation/scanner/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698