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

Side by Side Diff: tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart

Issue 658103003: Support map and list literals in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use LiteralMapEntry to ensure build order Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/elements/modelx.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // SExpressionUnstringifier implements the inverse operation to 5 // SExpressionUnstringifier implements the inverse operation to
6 // [SExpressionStringifier]. 6 // [SExpressionStringifier].
7 7
8 library sexpr_unstringifier; 8 library sexpr_unstringifier;
9 9
10 import 'package:compiler/implementation/constants/expressions.dart' 10 import 'package:compiler/implementation/constants/expressions.dart'
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 return new LiteralList(null, values); 652 return new LiteralList(null, values);
653 } 653 }
654 654
655 /// (LiteralMap keys values) 655 /// (LiteralMap keys values)
656 LiteralMap parseLiteralMap() { 656 LiteralMap parseLiteralMap() {
657 tokens.consumeStart(LITERAL_MAP); 657 tokens.consumeStart(LITERAL_MAP);
658 658
659 List<Primitive> keys = parsePrimitiveList(); 659 List<Primitive> keys = parsePrimitiveList();
660 List<Primitive> values = parsePrimitiveList(); 660 List<Primitive> values = parsePrimitiveList();
661 661
662 List<LiteralMapEntry> entries = <LiteralMapEntry>[];
663 for (int i = 0; i < keys.length; i++) {
664 entries.add(new LiteralMapEntry(keys[i], values[i]));
665 }
666
662 tokens.consumeEnd(); 667 tokens.consumeEnd();
663 return new LiteralMap(null, keys, values); 668 return new LiteralMap(null, entries);
664 } 669 }
665 670
666 /// (ReifyTypeVar type) 671 /// (ReifyTypeVar type)
667 ReifyTypeVar parseReifyTypeVar() { 672 ReifyTypeVar parseReifyTypeVar() {
668 tokens.consumeStart(REIFY_TYPE_VAR); 673 tokens.consumeStart(REIFY_TYPE_VAR);
669 674
670 TypeVariableElement type = new DummyElement(tokens.read()); 675 TypeVariableElement type = new DummyElement(tokens.read());
671 676
672 tokens.consumeEnd(); 677 tokens.consumeEnd();
673 return new ReifyTypeVar(type); 678 return new ReifyTypeVar(type);
674 } 679 }
675 680
676 /// (This) 681 /// (This)
677 This parseThis() { 682 This parseThis() {
678 tokens.consumeStart(THIS); 683 tokens.consumeStart(THIS);
679 tokens.consumeEnd(); 684 tokens.consumeEnd();
680 return new This(); 685 return new This();
681 } 686 }
682 } 687 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/elements/modelx.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698