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

Unified Diff: dart/frog/leg/scanner/partial_parser.dart

Issue 9663047: Repeated prefixes and parser fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased and status file Created 8 years, 9 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/frog/leg/scanner/parser.dart ('k') | dart/frog/leg/scanner/scanner_task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/scanner/partial_parser.dart
diff --git a/dart/frog/leg/scanner/partial_parser.dart b/dart/frog/leg/scanner/partial_parser.dart
index fa6ea9a8d30782862c8986155cb6aecdc5f56bb7..8771e73413536cb65292cae622328f7b53e379bb 100644
--- a/dart/frog/leg/scanner/partial_parser.dart
+++ b/dart/frog/leg/scanner/partial_parser.dart
@@ -20,6 +20,17 @@ class PartialParser extends Parser {
(value === ',') ||
(value === ']'))
return token;
+ if (value === '=' && token.next.stringValue === '{') {
+ // Handle cases like this:
+ // class Foo {
+ // var map;
+ // Foo() : map = {};
+ // }
+ BeginGroupToken begin = token.next;
+ token = (begin.endGroup !== null) ? begin.endGroup : token;
+ token = token.next;
+ continue;
+ }
if (!mayParseFunctionExpressions && value === '{')
return token;
if ((value !== '<') && (token is BeginGroupToken)) {
« no previous file with comments | « dart/frog/leg/scanner/parser.dart ('k') | dart/frog/leg/scanner/scanner_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698