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

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

Issue 2906333002: Move buildMethodInvocation to BodyBuilder. (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 '../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, MemberKind, optional; 10 import '../parser/parser.dart' show FormalParameterType, MemberKind, optional;
(...skipping 2758 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 } 2769 }
2770 for (Expression argument in expressions.reversed) { 2770 for (Expression argument in expressions.reversed) {
2771 expression = new Let( 2771 expression = new Let(
2772 new VariableDeclaration.forValue(argument, isFinal: true), 2772 new VariableDeclaration.forValue(argument, isFinal: true),
2773 expression); 2773 expression);
2774 } 2774 }
2775 return expression; 2775 return expression;
2776 } 2776 }
2777 2777
2778 @override 2778 @override
2779 Expression buildMethodInvocation(
2780 Expression receiver, Name name, Arguments arguments, int offset,
2781 {bool isConstantExpression: false, bool isNullAware: false}) {
2782 if (isNullAware) {
2783 VariableDeclaration variable = new VariableDeclaration.forValue(receiver);
2784 return makeLet(
2785 variable,
2786 new ConditionalExpression(
2787 buildIsNull(new VariableGet(variable)),
2788 new NullLiteral(),
2789 new MethodInvocation(new VariableGet(variable), name, arguments)
2790 ..fileOffset = offset,
2791 const DynamicType()));
2792 } else {
2793 return new KernelMethodInvocation(receiver, name, arguments)
2794 ..fileOffset = offset;
2795 }
2796 }
2797
2798 @override
2779 void addCompileTimeErrorFromMessage(FastaMessage message) { 2799 void addCompileTimeErrorFromMessage(FastaMessage message) {
2780 library.addCompileTimeError(message.charOffset, message.message, 2800 library.addCompileTimeError(message.charOffset, message.message,
2781 fileUri: message.uri); 2801 fileUri: message.uri);
2782 } 2802 }
2783 2803
2784 @override 2804 @override
2785 void debugEvent(String name) { 2805 void debugEvent(String name) {
2786 // printEvent(name); 2806 // printEvent(name);
2787 } 2807 }
2788 2808
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
3249 if (starToken == null) { 3269 if (starToken == null) {
3250 return AsyncMarker.Async; 3270 return AsyncMarker.Async;
3251 } else { 3271 } else {
3252 assert(identical(starToken.stringValue, "*")); 3272 assert(identical(starToken.stringValue, "*"));
3253 return AsyncMarker.AsyncStar; 3273 return AsyncMarker.AsyncStar;
3254 } 3274 }
3255 } else { 3275 } else {
3256 return internalError("Unknown async modifier: $asyncToken"); 3276 return internalError("Unknown async modifier: $asyncToken");
3257 } 3277 }
3258 } 3278 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698