| 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 'package:front_end/src/fasta/parser/parser.dart' show | 7 import 'package:front_end/src/fasta/parser/parser.dart' show |
| 8 FormalParameterType, | 8 FormalParameterType, |
| 9 optional; | 9 optional; |
| 10 | 10 |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 if (builder == null) { | 1163 if (builder == null) { |
| 1164 warning("Type not found: '$name'.", charOffset); | 1164 warning("Type not found: '$name'.", charOffset); |
| 1165 } else { | 1165 } else { |
| 1166 warning("Not a type: '$name'.", charOffset); | 1166 warning("Not a type: '$name'.", charOffset); |
| 1167 } | 1167 } |
| 1168 // TODO(ahe): Create an error somehow. | 1168 // TODO(ahe): Create an error somehow. |
| 1169 return const DynamicType(); | 1169 return const DynamicType(); |
| 1170 } | 1170 } |
| 1171 | 1171 |
| 1172 @override | 1172 @override |
| 1173 void handleType(Token beginToken, Token endToken) { | 1173 void endType(Token beginToken, Token endToken) { |
| 1174 // TODO(ahe): The scope is wrong for return types of generic functions. | 1174 // TODO(ahe): The scope is wrong for return types of generic functions. |
| 1175 debugEvent("Type"); | 1175 debugEvent("Type"); |
| 1176 List<DartType> arguments = pop(); | 1176 List<DartType> arguments = pop(); |
| 1177 dynamic name = pop(); | 1177 dynamic name = pop(); |
| 1178 if (name is List) { | 1178 if (name is List) { |
| 1179 if (name.length != 2) { | 1179 if (name.length != 2) { |
| 1180 internalError("Unexpected: $name.length"); | 1180 internalError("Unexpected: $name.length"); |
| 1181 } | 1181 } |
| 1182 var prefix = name[0]; | 1182 var prefix = name[0]; |
| 1183 if (prefix is Identifier) { | 1183 if (prefix is Identifier) { |
| (...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2696 } else if (node is TypeDeclarationBuilder) { | 2696 } else if (node is TypeDeclarationBuilder) { |
| 2697 return node.name; | 2697 return node.name; |
| 2698 } else if (node is PrefixBuilder) { | 2698 } else if (node is PrefixBuilder) { |
| 2699 return node.name; | 2699 return node.name; |
| 2700 } else if (node is ThisPropertyAccessor) { | 2700 } else if (node is ThisPropertyAccessor) { |
| 2701 return node.name.name; | 2701 return node.name.name; |
| 2702 } else { | 2702 } else { |
| 2703 return internalError("Unhandled: ${node.runtimeType}"); | 2703 return internalError("Unhandled: ${node.runtimeType}"); |
| 2704 } | 2704 } |
| 2705 } | 2705 } |
| OLD | NEW |