| 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 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 if (builder == null) { | 1150 if (builder == null) { |
| 1151 print("$uri: Type not found: $name"); | 1151 print("$uri: Type not found: $name"); |
| 1152 } else { | 1152 } else { |
| 1153 print("$uri: Not a type: $name"); | 1153 print("$uri: Not a type: $name"); |
| 1154 } | 1154 } |
| 1155 // TODO(ahe): Create an error somehow. | 1155 // TODO(ahe): Create an error somehow. |
| 1156 return const DynamicType(); | 1156 return const DynamicType(); |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 @override | 1159 @override |
| 1160 void endType(Token beginToken, Token endToken) { | 1160 void handleType(Token beginToken, Token endToken) { |
| 1161 // TODO(ahe): The scope is wrong for return types of generic functions. | 1161 // TODO(ahe): The scope is wrong for return types of generic functions. |
| 1162 debugEvent("Type"); | 1162 debugEvent("Type"); |
| 1163 List<DartType> arguments = pop(); | 1163 List<DartType> arguments = pop(); |
| 1164 var name = pop(); | 1164 var name = pop(); |
| 1165 if (name is List) { | 1165 if (name is List) { |
| 1166 if (name.length != 2) { | 1166 if (name.length != 2) { |
| 1167 return internalError("Unexpected: $name.length"); | 1167 return internalError("Unexpected: $name.length"); |
| 1168 } | 1168 } |
| 1169 var prefix = name[0]; | 1169 var prefix = name[0]; |
| 1170 if (prefix is Identifier) { | 1170 if (prefix is Identifier) { |
| (...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2674 } else if (node is TypeDeclarationBuilder) { | 2674 } else if (node is TypeDeclarationBuilder) { |
| 2675 return node.name; | 2675 return node.name; |
| 2676 } else if (node is PrefixBuilder) { | 2676 } else if (node is PrefixBuilder) { |
| 2677 return node.name; | 2677 return node.name; |
| 2678 } else if (node is ThisPropertyAccessor) { | 2678 } else if (node is ThisPropertyAccessor) { |
| 2679 return node.name.name; | 2679 return node.name.name; |
| 2680 } else { | 2680 } else { |
| 2681 return internalError("Unhandled: ${node.runtimeType}"); | 2681 return internalError("Unhandled: ${node.runtimeType}"); |
| 2682 } | 2682 } |
| 2683 } | 2683 } |
| OLD | NEW |