OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library fasta.body_builder; | 5 library fasta.body_builder; |
6 | 6 |
7 import '../fasta_codes.dart' | 7 import '../fasta_codes.dart' |
8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody; | 8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody; |
9 | 9 |
10 import '../parser/parser.dart' show FormalParameterType, optional; | 10 import '../parser/parser.dart' show FormalParameterType, optional; |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 push(new ParenthesizedExpression(this, popForValue(), token.endGroup)); | 579 push(new ParenthesizedExpression(this, popForValue(), token.endGroup)); |
580 } | 580 } |
581 | 581 |
582 @override | 582 @override |
583 void endSend(Token beginToken, Token endToken) { | 583 void endSend(Token beginToken, Token endToken) { |
584 debugEvent("Send"); | 584 debugEvent("Send"); |
585 Arguments arguments = pop(); | 585 Arguments arguments = pop(); |
586 List<DartType> typeArguments = pop(); | 586 List<DartType> typeArguments = pop(); |
587 Object receiver = pop(); | 587 Object receiver = pop(); |
588 if (arguments != null && typeArguments != null) { | 588 if (arguments != null && typeArguments != null) { |
589 arguments.types.addAll(typeArguments); | 589 assert(arguments.types.isEmpty); |
| 590 astFactory.setExplicitArgumentTypes(arguments, typeArguments); |
590 } else { | 591 } else { |
591 assert(typeArguments == null); | 592 assert(typeArguments == null); |
592 } | 593 } |
593 if (receiver is Identifier) { | 594 if (receiver is Identifier) { |
594 Name name = new Name(receiver.name, library.library); | 595 Name name = new Name(receiver.name, library.library); |
595 if (arguments == null) { | 596 if (arguments == null) { |
596 push(new IncompletePropertyAccessor(this, beginToken, name)); | 597 push(new IncompletePropertyAccessor(this, beginToken, name)); |
597 } else { | 598 } else { |
598 push(new SendAccessor(this, beginToken, name, arguments)); | 599 push(new SendAccessor(this, beginToken, name, arguments)); |
599 } | 600 } |
(...skipping 2530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3130 } else if (node is PrefixBuilder) { | 3131 } else if (node is PrefixBuilder) { |
3131 return node.name; | 3132 return node.name; |
3132 } else if (node is ThisAccessor) { | 3133 } else if (node is ThisAccessor) { |
3133 return node.isSuper ? "super" : "this"; | 3134 return node.isSuper ? "super" : "this"; |
3134 } else if (node is FastaAccessor) { | 3135 } else if (node is FastaAccessor) { |
3135 return node.plainNameForRead; | 3136 return node.plainNameForRead; |
3136 } else { | 3137 } else { |
3137 return internalError("Unhandled: ${node.runtimeType}"); | 3138 return internalError("Unhandled: ${node.runtimeType}"); |
3138 } | 3139 } |
3139 } | 3140 } |
OLD | NEW |