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

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

Issue 2767653002: Implement fullNameForErrors on all Builders. (Closed)
Patch Set: Used <unnamed> instead of empty string. Created 3 years, 9 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.builder_accessors; 5 library fasta.builder_accessors;
6 6
7 export 'frontend_accessors.dart' show wrapInvalid; 7 export 'frontend_accessors.dart' show wrapInvalid;
8 8
9 import 'frontend_accessors.dart' show Accessor; 9 import 'frontend_accessors.dart' show Accessor;
10 10
11 import 'package:kernel/ast.dart'; 11 import 'package:kernel/ast.dart';
12 12
13 import 'package:kernel/core_types.dart' show CoreTypes; 13 import 'package:kernel/core_types.dart' show CoreTypes;
14 14
15 import '../builder/scope.dart' show ProblemBuilder;
16
15 import '../errors.dart' show internalError, printUnexpected; 17 import '../errors.dart' show internalError, printUnexpected;
16 18
17 import 'frontend_accessors.dart' as kernel 19 import 'frontend_accessors.dart' as kernel
18 show 20 show
19 IndexAccessor, 21 IndexAccessor,
20 NullAwarePropertyAccessor, 22 NullAwarePropertyAccessor,
21 PropertyAccessor, 23 PropertyAccessor,
22 StaticAccessor, 24 StaticAccessor,
23 SuperIndexAccessor, 25 SuperIndexAccessor,
24 SuperPropertyAccessor, 26 SuperPropertyAccessor,
(...skipping 22 matching lines...) Expand all
47 builderToFirstExpression(Builder builder, String name, int charOffset); 49 builderToFirstExpression(Builder builder, String name, int charOffset);
48 50
49 finishSend(Object receiver, Arguments arguments, int charOffset); 51 finishSend(Object receiver, Arguments arguments, int charOffset);
50 52
51 Expression buildCompileTimeError(error, [int charOffset]); 53 Expression buildCompileTimeError(error, [int charOffset]);
52 54
53 Initializer buildCompileTimeErrorIntializer(error, [int charOffset]); 55 Initializer buildCompileTimeErrorIntializer(error, [int charOffset]);
54 56
55 Expression buildStaticInvocation(Procedure target, Arguments arguments); 57 Expression buildStaticInvocation(Procedure target, Arguments arguments);
56 58
57 Expression buildProblemExpression(Builder builder, String name); 59 Expression buildProblemExpression(ProblemBuilder builder, int charOffset);
58 } 60 }
59 61
60 abstract class BuilderAccessor implements Accessor { 62 abstract class BuilderAccessor implements Accessor {
61 BuilderHelper get helper; 63 BuilderHelper get helper;
62 64
63 int get charOffset; 65 int get charOffset;
64 66
65 String get plainNameForRead; 67 String get plainNameForRead;
66 68
67 Uri get uri => helper.uri; 69 Uri get uri => helper.uri;
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 prefix.exports[name.name], "${prefix.name}.${name.name}", charOffset); 342 prefix.exports[name.name], "${prefix.name}.${name.name}", charOffset);
341 return helper.finishSend(receiver, arguments, charOffset); 343 return helper.finishSend(receiver, arguments, charOffset);
342 } 344 }
343 Expression result; 345 Expression result;
344 if (receiver is KernelClassBuilder) { 346 if (receiver is KernelClassBuilder) {
345 Builder builder = receiver.findStaticBuilder(name.name, charOffset, uri); 347 Builder builder = receiver.findStaticBuilder(name.name, charOffset, uri);
346 if (builder == null) { 348 if (builder == null) {
347 return buildThrowNoSuchMethodError(arguments); 349 return buildThrowNoSuchMethodError(arguments);
348 } 350 }
349 if (builder.hasProblem) { 351 if (builder.hasProblem) {
350 result = helper.buildProblemExpression(builder, name.name); 352 result = helper.buildProblemExpression(builder, charOffset);
351 } else { 353 } else {
352 Member target = builder.target; 354 Member target = builder.target;
353 if (target != null) { 355 if (target != null) {
354 if (target is Field) { 356 if (target is Field) {
355 result = buildMethodInvocation( 357 result = buildMethodInvocation(
356 new StaticGet(target), new Name("call"), arguments, charOffset, 358 new StaticGet(target), new Name("call"), arguments, charOffset,
357 isNullAware: isNullAware); 359 isNullAware: isNullAware);
358 } else { 360 } else {
359 result = helper.buildStaticInvocation(target, arguments); 361 result = helper.buildStaticInvocation(target, arguments);
360 } 362 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 Member setter; 433 Member setter;
432 if (builder == null) { 434 if (builder == null) {
433 builder = receiver.findStaticBuilder(name.name, charOffset, uri, 435 builder = receiver.findStaticBuilder(name.name, charOffset, uri,
434 isSetter: true); 436 isSetter: true);
435 if (builder == null) { 437 if (builder == null) {
436 return buildThrowNoSuchMethodError(null); 438 return buildThrowNoSuchMethodError(null);
437 } 439 }
438 setter = builder.target; 440 setter = builder.target;
439 } 441 }
440 if (builder.hasProblem) { 442 if (builder.hasProblem) {
441 return helper.buildProblemExpression(builder, name.name) 443 return helper.buildProblemExpression(builder, charOffset);
442 ..fileOffset = charOffset;
443 } 444 }
444 if (getter is Field) { 445 if (getter is Field) {
445 if (!getter.isFinal && !getter.isConst) { 446 if (!getter.isFinal && !getter.isConst) {
446 setter = getter; 447 setter = getter;
447 } 448 }
448 } else if (getter is Procedure) { 449 } else if (getter is Procedure) {
449 if (getter.isGetter) { 450 if (getter.isGetter) {
450 builder = receiver.findStaticBuilder(name.name, charOffset, uri, 451 builder = receiver.findStaticBuilder(name.name, charOffset, uri,
451 isSetter: true); 452 isSetter: true);
452 if (builder != null && !builder.hasProblem) { 453 if (builder != null && !builder.hasProblem) {
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 buildIsNull(new VariableGet(variable)), 757 buildIsNull(new VariableGet(variable)),
757 new NullLiteral(), 758 new NullLiteral(),
758 new MethodInvocation(new VariableGet(variable), name, arguments) 759 new MethodInvocation(new VariableGet(variable), name, arguments)
759 ..fileOffset = charOffset, 760 ..fileOffset = charOffset,
760 const DynamicType())); 761 const DynamicType()));
761 } else { 762 } else {
762 return new MethodInvocation(receiver, name, arguments) 763 return new MethodInvocation(receiver, name, arguments)
763 ..fileOffset = charOffset; 764 ..fileOffset = charOffset;
764 } 765 }
765 } 766 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | pkg/front_end/lib/src/fasta/kernel/kernel_variable_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698