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/src/constants/expressions.dart'; | 10 import 'package:compiler/src/constants/expressions.dart'; |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 TypeOperator parseTypeOperator() { | 557 TypeOperator parseTypeOperator() { |
558 tokens.consumeStart(TYPE_OPERATOR); | 558 tokens.consumeStart(TYPE_OPERATOR); |
559 | 559 |
560 String operator = tokens.read(); | 560 String operator = tokens.read(); |
561 | 561 |
562 Primitive recv = name2variable[tokens.read()]; | 562 Primitive recv = name2variable[tokens.read()]; |
563 assert(recv != null); | 563 assert(recv != null); |
564 | 564 |
565 dart_types.DartType type = new DummyNamedType(tokens.read()); | 565 dart_types.DartType type = new DummyNamedType(tokens.read()); |
566 | 566 |
| 567 List<ir.Primitive> typeArguments = parsePrimitiveList(); |
| 568 |
567 Continuation cont = name2variable[tokens.read()]; | 569 Continuation cont = name2variable[tokens.read()]; |
568 assert(cont != null); | 570 assert(cont != null); |
569 | 571 |
570 tokens.consumeEnd(); | 572 tokens.consumeEnd(); |
571 return new TypeOperator(recv, type, cont, isTypeTest: operator == 'is'); | 573 return new TypeOperator(recv, type, typeArguments, cont, |
| 574 isTypeTest: operator == 'is'); |
572 } | 575 } |
573 | 576 |
574 /// (SetStatic field value body) | 577 /// (SetStatic field value body) |
575 SetStatic parseSetStatic() { | 578 SetStatic parseSetStatic() { |
576 tokens.consumeStart(SET_STATIC); | 579 tokens.consumeStart(SET_STATIC); |
577 | 580 |
578 Element fieldElement = new DummyElement(tokens.read()); | 581 Element fieldElement = new DummyElement(tokens.read()); |
579 Primitive value = name2variable[tokens.read()]; | 582 Primitive value = name2variable[tokens.read()]; |
580 assert(value != null); | 583 assert(value != null); |
581 Expression body = parseExpression(); | 584 Expression body = parseExpression(); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 /// (GetStatic field) | 766 /// (GetStatic field) |
764 GetStatic parseGetStatic() { | 767 GetStatic parseGetStatic() { |
765 tokens.consumeStart(GET_STATIC); | 768 tokens.consumeStart(GET_STATIC); |
766 | 769 |
767 Element field = new DummyElement(tokens.read()); | 770 Element field = new DummyElement(tokens.read()); |
768 | 771 |
769 tokens.consumeEnd(); | 772 tokens.consumeEnd(); |
770 return new GetStatic(field, null); | 773 return new GetStatic(field, null); |
771 } | 774 } |
772 } | 775 } |
OLD | NEW |