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

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

Issue 2940453002: Add offsets to the `== null` calls inserted by null-aware desugaring. (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
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.fasta_accessors; 5 library fasta.fasta_accessors;
6 6
7 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart' 7 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'
8 show 8 show
9 KernelArguments, 9 KernelArguments,
10 KernelComplexAssignment, 10 KernelComplexAssignment,
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 @override 270 @override
271 Expression buildPostfixIncrement(Name binaryOperator, 271 Expression buildPostfixIncrement(Name binaryOperator,
272 {int offset: TreeNode.noOffset, 272 {int offset: TreeNode.noOffset,
273 bool voidContext: false, 273 bool voidContext: false,
274 Procedure interfaceTarget}) { 274 Procedure interfaceTarget}) {
275 return buildError(new KernelArguments(<Expression>[new IntLiteral(1)]), 275 return buildError(new KernelArguments(<Expression>[new IntLiteral(1)]),
276 isGetter: true); 276 isGetter: true);
277 } 277 }
278 278
279 @override 279 @override
280 Expression buildNullAwareAssignment(Expression value, DartType type, 280 Expression buildNullAwareAssignment(
281 Expression value, DartType type, int offset,
281 {bool voidContext: false}) { 282 {bool voidContext: false}) {
282 return buildError(new KernelArguments(<Expression>[value]), isSetter: true); 283 return buildError(new KernelArguments(<Expression>[value]), isSetter: true);
283 } 284 }
284 285
285 @override 286 @override
286 Expression buildSimpleRead() => 287 Expression buildSimpleRead() =>
287 buildError(new Arguments.empty(), isGetter: true); 288 buildError(new Arguments.empty(), isGetter: true);
288 289
289 @override 290 @override
290 Expression makeInvalidRead() => 291 Expression makeInvalidRead() =>
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 return helper.buildSuperInitializer(constructor, arguments, offset); 387 return helper.buildSuperInitializer(constructor, arguments, offset);
387 } else { 388 } else {
388 return helper.buildRedirectingInitializer(constructor, arguments, offset); 389 return helper.buildRedirectingInitializer(constructor, arguments, offset);
389 } 390 }
390 } 391 }
391 392
392 Expression buildAssignment(Expression value, {bool voidContext: false}) { 393 Expression buildAssignment(Expression value, {bool voidContext: false}) {
393 return buildAssignmentError(); 394 return buildAssignmentError();
394 } 395 }
395 396
396 Expression buildNullAwareAssignment(Expression value, DartType type, 397 Expression buildNullAwareAssignment(
398 Expression value, DartType type, int offset,
397 {bool voidContext: false}) { 399 {bool voidContext: false}) {
398 return buildAssignmentError(); 400 return buildAssignmentError();
399 } 401 }
400 402
401 Expression buildCompoundAssignment(Name binaryOperator, Expression value, 403 Expression buildCompoundAssignment(Name binaryOperator, Expression value,
402 {int offset: TreeNode.noOffset, 404 {int offset: TreeNode.noOffset,
403 bool voidContext: false, 405 bool voidContext: false,
404 Procedure interfaceTarget, 406 Procedure interfaceTarget,
405 bool isPreIncDec: false}) { 407 bool isPreIncDec: false}) {
406 return buildAssignmentError(); 408 return buildAssignmentError();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } 499 }
498 receiver = helper.scopeLookup(prefix.exports, name.name, token, 500 receiver = helper.scopeLookup(prefix.exports, name.name, token,
499 isQualified: true, prefix: prefix); 501 isQualified: true, prefix: prefix);
500 return helper.finishSend(receiver, arguments, offsetForToken(token)); 502 return helper.finishSend(receiver, arguments, offsetForToken(token));
501 } 503 }
502 return helper.buildMethodInvocation( 504 return helper.buildMethodInvocation(
503 helper.toValue(receiver), name, arguments, offsetForToken(token), 505 helper.toValue(receiver), name, arguments, offsetForToken(token),
504 isNullAware: isNullAware); 506 isNullAware: isNullAware);
505 } 507 }
506 508
507 Expression buildNullAwareAssignment(Expression value, DartType type, 509 Expression buildNullAwareAssignment(
510 Expression value, DartType type, int offset,
508 {bool voidContext: false}) { 511 {bool voidContext: false}) {
509 return internalError("Unhandled"); 512 return internalError("Unhandled");
510 } 513 }
511 514
512 Expression buildCompoundAssignment(Name binaryOperator, Expression value, 515 Expression buildCompoundAssignment(Name binaryOperator, Expression value,
513 {int offset, 516 {int offset,
514 bool voidContext: false, 517 bool voidContext: false,
515 Procedure interfaceTarget, 518 Procedure interfaceTarget,
516 bool isPreIncDec: false}) { 519 bool isPreIncDec: false}) {
517 return internalError("Unhandled"); 520 return internalError("Unhandled");
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 "operator.\nTry removing '?'."); 565 "operator.\nTry removing '?'.");
563 } 566 }
564 return helper.scopeLookup(prefix.exports, name.name, token, 567 return helper.scopeLookup(prefix.exports, name.name, token,
565 isQualified: true, prefix: prefix); 568 isQualified: true, prefix: prefix);
566 } 569 }
567 570
568 return PropertyAccessor.make( 571 return PropertyAccessor.make(
569 helper, token, helper.toValue(receiver), name, null, null, isNullAware); 572 helper, token, helper.toValue(receiver), name, null, null, isNullAware);
570 } 573 }
571 574
572 Expression buildNullAwareAssignment(Expression value, DartType type, 575 Expression buildNullAwareAssignment(
576 Expression value, DartType type, int offset,
573 {bool voidContext: false}) { 577 {bool voidContext: false}) {
574 return internalError("Unhandled"); 578 return internalError("Unhandled");
575 } 579 }
576 580
577 Expression buildCompoundAssignment(Name binaryOperator, Expression value, 581 Expression buildCompoundAssignment(Name binaryOperator, Expression value,
578 {int offset, 582 {int offset,
579 bool voidContext: false, 583 bool voidContext: false,
580 Procedure interfaceTarget, 584 Procedure interfaceTarget,
581 bool isPreIncDec: false}) { 585 bool isPreIncDec: false}) {
582 return internalError("Unhandled"); 586 return internalError("Unhandled");
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 offset ??= offsetForToken(this.token); 1037 offset ??= offsetForToken(this.token);
1034 return helper.throwNoSuchMethodError(new NullLiteral()..fileOffset = offset, 1038 return helper.throwNoSuchMethodError(new NullLiteral()..fileOffset = offset,
1035 plainNameForRead, arguments, offset, 1039 plainNameForRead, arguments, offset,
1036 isGetter: isGetter, isSetter: isSetter); 1040 isGetter: isGetter, isSetter: isSetter);
1037 } 1041 }
1038 } 1042 }
1039 1043
1040 bool isFieldOrGetter(Member member) { 1044 bool isFieldOrGetter(Member member) {
1041 return member is Field || (member is Procedure && member.isGetter); 1045 return member is Field || (member is Procedure && member.isGetter);
1042 } 1046 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698