| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |