Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2567133002: Add support for the new function-type syntax. (Closed)
Patch Set: Fixes after rebase. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 if (builder == null) { 1165 if (builder == null) {
1166 warning("Type not found: '$name'.", charOffset); 1166 warning("Type not found: '$name'.", charOffset);
1167 } else { 1167 } else {
1168 warning("Not a type: '$name'.", charOffset); 1168 warning("Not a type: '$name'.", charOffset);
1169 } 1169 }
1170 // TODO(ahe): Create an error somehow. 1170 // TODO(ahe): Create an error somehow.
1171 return const DynamicType(); 1171 return const DynamicType();
1172 } 1172 }
1173 1173
1174 @override 1174 @override
1175 void endType(Token beginToken, Token endToken) { 1175 void handleType(Token beginToken, Token endToken) {
1176 // TODO(ahe): The scope is wrong for return types of generic functions. 1176 // TODO(ahe): The scope is wrong for return types of generic functions.
1177 debugEvent("Type"); 1177 debugEvent("Type");
1178 List<DartType> arguments = pop(); 1178 List<DartType> arguments = pop();
1179 dynamic name = pop(); 1179 dynamic name = pop();
1180 if (name is List) { 1180 if (name is List) {
1181 if (name.length != 2) { 1181 if (name.length != 2) {
1182 internalError("Unexpected: $name.length"); 1182 internalError("Unexpected: $name.length");
1183 } 1183 }
1184 var prefix = name[0]; 1184 var prefix = name[0];
1185 if (prefix is Identifier) { 1185 if (prefix is Identifier) {
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
2698 } else if (node is TypeDeclarationBuilder) { 2698 } else if (node is TypeDeclarationBuilder) {
2699 return node.name; 2699 return node.name;
2700 } else if (node is PrefixBuilder) { 2700 } else if (node is PrefixBuilder) {
2701 return node.name; 2701 return node.name;
2702 } else if (node is ThisPropertyAccessor) { 2702 } else if (node is ThisPropertyAccessor) {
2703 return node.name.name; 2703 return node.name.name;
2704 } else { 2704 } else {
2705 return internalError("Unhandled: ${node.runtimeType}"); 2705 return internalError("Unhandled: ${node.runtimeType}");
2706 } 2706 }
2707 } 2707 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698