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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart

Issue 18117004: Handle map literals in conditional expression in PartialParser.skipExpression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | « no previous file | dart/tests/language/class_syntax2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart b/dart/sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart
index 02f409aac925223384afdd0fd28a9109d0810ee2..3b666ae53d796e9e451068d1b7247de2a5f37394 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart
@@ -34,7 +34,9 @@ class PartialParser extends Parser {
(identical(value, ',')) ||
(identical(value, ']')))
return token;
- if (identical(value, '=')) {
+ if (identical(value, '=') ||
+ identical(value, '?') ||
+ identical(value, ':')) {
var nextValue = token.next.stringValue;
if (identical(nextValue, 'const')) {
token = token.next;
@@ -45,6 +47,7 @@ class PartialParser extends Parser {
// class Foo {
// var map;
// Foo() : map = {};
+ // Foo.x() : map = true ? {} : {};
// }
BeginGroupToken begin = token.next;
token = (begin.endGroup != null) ? begin.endGroup : token;
@@ -56,6 +59,7 @@ class PartialParser extends Parser {
// class Foo {
// var map;
// Foo() : map = <String, Foo>{};
+ // Foo.x() : map = true ? <String, Foo>{} : <String, Foo>{};
// }
BeginGroupToken begin = token.next;
token = (begin.endGroup != null) ? begin.endGroup : token;
« no previous file with comments | « no previous file | dart/tests/language/class_syntax2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698