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

Unified Diff: runtime/vm/parser.cc

Issue 22835005: Fix top-level map literals (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 | tests/language/compile_time_constant_c_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 26062)
+++ runtime/vm/parser.cc (working copy)
@@ -9237,7 +9237,6 @@
AstNode* value) {
if (is_const) {
ASSERT(key->IsLiteralNode());
- ASSERT(key->AsLiteralNode()->literal().IsString());
const Instance& new_key = key->AsLiteralNode()->literal();
for (int i = 0; i < pairs->length(); i += 2) {
const Instance& key_i =
@@ -10046,6 +10045,8 @@
SkipNestedExpr();
if (CurrentToken() == Token::kCOMMA) {
ConsumeToken();
+ } else {
+ break;
}
}
ExpectToken(Token::kRBRACK);
@@ -10054,12 +10055,14 @@
void Parser::SkipMapLiteral() {
ExpectToken(Token::kLBRACE);
- while (CurrentToken() == Token::kSTRING) {
- SkipStringLiteral();
+ while (CurrentToken() != Token::kRBRACE) {
+ SkipNestedExpr();
ExpectToken(Token::kCOLON);
SkipNestedExpr();
if (CurrentToken() == Token::kCOMMA) {
ConsumeToken();
+ } else {
+ break;
}
}
ExpectToken(Token::kRBRACE);
« no previous file with comments | « no previous file | tests/language/compile_time_constant_c_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698