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

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

Issue 2716433002: Add support for FieldFormalParameter. (Closed)
Patch Set: 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 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 } 1268 }
1269 1269
1270 @override 1270 @override
1271 void endThrowExpression(Token throwToken, Token endToken) { 1271 void endThrowExpression(Token throwToken, Token endToken) {
1272 debugEvent("ThrowExpression"); 1272 debugEvent("ThrowExpression");
1273 Expression expression = popForValue(); 1273 Expression expression = popForValue();
1274 push(new Throw(expression)); 1274 push(new Throw(expression));
1275 } 1275 }
1276 1276
1277 @override 1277 @override
1278 void endFormalParameter(Token thisKeyword) { 1278 void endFormalParameter(Token thisKeyword, Token period) {
1279 debugEvent("FormalParameter"); 1279 debugEvent("FormalParameter");
1280 // TODO(ahe): Need beginToken here. 1280 // TODO(ahe): Need beginToken here.
1281 int charOffset = thisKeyword?.charOffset; 1281 int charOffset = thisKeyword?.charOffset;
1282 if (thisKeyword != null) { 1282 if (thisKeyword != null) {
1283 if (!inConstructor) { 1283 if (!inConstructor) {
1284 addCompileTimeError(thisKeyword.charOffset, 1284 addCompileTimeError(thisKeyword.charOffset,
1285 "'this' parameters can only be used on constructors."); 1285 "'this' parameters can only be used on constructors.");
1286 thisKeyword = null; 1286 thisKeyword = null;
1287 } 1287 }
1288 } 1288 }
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698