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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.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 side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index ef270ba87bc2ad0b7f0794ef46ed6cb8ebc97ef0..92671c060799d1a04b6ede8b2e56d2d9f615e710 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -30,7 +30,7 @@ import '../errors.dart' show formatUnexpected, internalError;
import '../source/scope_listener.dart'
show JumpTargetKind, NullValue, ScopeListener;
-import '../builder/scope.dart' show AccessErrorBuilder, AmbiguousBuilder, Scope;
+import '../builder/scope.dart' show ProblemBuilder, Scope;
import '../source/outline_builder.dart' show asyncMarkerFromTokens;
@@ -2267,14 +2267,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
}
@override
- Expression buildProblemExpression(Builder builder, String name) {
- if (builder is AmbiguousBuilder) {
- return buildCompileTimeError("Duplicated named: '$name'.");
- } else if (builder is AccessErrorBuilder) {
- return buildCompileTimeError("Access error: '$name'.");
- } else {
- return internalError("Unhandled: ${builder.runtimeType}");
- }
+ Expression buildProblemExpression(ProblemBuilder builder, int charOffset) {
+ return buildCompileTimeError(builder.message, charOffset);
}
@override
@@ -2589,6 +2583,9 @@ class JumpTarget extends Builder {
}
users.clear();
}
+
+ @override
+ String get fullNameForErrors => "<jump-target>";
}
class LabelTarget extends Builder implements JumpTarget {
@@ -2640,6 +2637,9 @@ class LabelTarget extends Builder implements JumpTarget {
void resolveGotos(SwitchCase target) {
internalError("Unsupported operation.");
}
+
+ @override
+ String get fullNameForErrors => "<label-target>";
}
class OptionalFormals {
« no previous file with comments | « pkg/front_end/lib/src/fasta/dill/dill_library_builder.dart ('k') | pkg/front_end/lib/src/fasta/kernel/builder_accessors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698