OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 /// Logic to build unlinked summaries. | 5 /// Logic to build unlinked summaries. |
6 library summary.src.summary_builder; | 6 library summary.src.summary_builder; |
7 | 7 |
8 import 'package:front_end/src/fasta/parser.dart' | 8 import 'package:front_end/src/fasta/parser.dart' |
9 show | 9 show |
10 ClassMemberParser, | 10 ClassMemberParser, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 if (ignore) return; | 119 if (ignore) return; |
120 push(new As(pop(), pop())); | 120 push(new As(pop(), pop())); |
121 } | 121 } |
122 | 122 |
123 void handleAssignmentExpression(Token operator) { | 123 void handleAssignmentExpression(Token operator) { |
124 pop(); // lhs | 124 pop(); // lhs |
125 pop(); // rhs | 125 pop(); // rhs |
126 push(new Invalid(hint: "assign")); | 126 push(new Invalid(hint: "assign")); |
127 } | 127 } |
128 | 128 |
129 void handleIndexedExpression(Token openSquareBracket, Token token) { | 129 void handleIndexedExpression( |
| 130 Token openSquareBracket, Token closeSquareBracket) { |
130 debugEvent("Index"); | 131 debugEvent("Index"); |
131 if (ignore) return; | 132 if (ignore) return; |
132 pop(); // receiver | 133 pop(); // receiver |
133 pop(); // index | 134 pop(); // index |
134 push(new Invalid(hint: "index")); | 135 push(new Invalid(hint: "index")); |
135 } | 136 } |
136 | 137 |
137 void handleNamedArgument(colon) { | 138 void handleNamedArgument(colon) { |
138 debugEvent("NamedArg"); | 139 debugEvent("NamedArg"); |
139 if (ignore) return; | 140 if (ignore) return; |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 var left = pop(); | 645 var left = pop(); |
645 var right = pop(); | 646 var right = pop(); |
646 var kind = operator.kind; | 647 var kind = operator.kind; |
647 if (kind == EQ_TOKEN) { | 648 if (kind == EQ_TOKEN) { |
648 push(new OpaqueOp(right)); | 649 push(new OpaqueOp(right)); |
649 } else { | 650 } else { |
650 push(new OpaqueOp(new Binary(left, right, opForAssignOp(kind)))); | 651 push(new OpaqueOp(new Binary(left, right, opForAssignOp(kind)))); |
651 } | 652 } |
652 } | 653 } |
653 | 654 |
654 void handleIndexedExpression(Token openSquareBracket, Token token) { | 655 void handleIndexedExpression( |
| 656 Token openSquareBracket, Token closeSquareBracket) { |
655 debugEvent("Index"); | 657 debugEvent("Index"); |
656 if (ignore) return; | 658 if (ignore) return; |
657 pop(); | 659 pop(); |
658 pop(); | 660 pop(); |
659 push(new Opaque()); | 661 push(new Opaque()); |
660 } | 662 } |
661 | 663 |
662 void handleIsOperator(Token operator, Token not, Token endToken) { | 664 void handleIsOperator(Token operator, Token not, Token endToken) { |
663 debugEvent("Is"); | 665 debugEvent("Is"); |
664 if (ignore) return; | 666 if (ignore) return; |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1558 } | 1560 } |
1559 | 1561 |
1560 /// Internal representation of an initialized name. | 1562 /// Internal representation of an initialized name. |
1561 class _InitializedName { | 1563 class _InitializedName { |
1562 final String name; | 1564 final String name; |
1563 final UnlinkedExecutableBuilder initializer; | 1565 final UnlinkedExecutableBuilder initializer; |
1564 _InitializedName(this.name, this.initializer); | 1566 _InitializedName(this.name, this.initializer); |
1565 | 1567 |
1566 toString() => "II:" + (initializer != null ? "$name = $initializer" : name); | 1568 toString() => "II:" + (initializer != null ? "$name = $initializer" : name); |
1567 } | 1569 } |
OLD | NEW |