Index: pkg/front_end/lib/src/fasta/builder/library_builder.dart |
diff --git a/pkg/front_end/lib/src/fasta/builder/library_builder.dart b/pkg/front_end/lib/src/fasta/builder/library_builder.dart |
index 8442213be8b387e52c783da10a870eebda9c3f81..598f5e7d570cf55de3a8bd4d0d8f41a026962324 100644 |
--- a/pkg/front_end/lib/src/fasta/builder/library_builder.dart |
+++ b/pkg/front_end/lib/src/fasta/builder/library_builder.dart |
@@ -6,7 +6,7 @@ library fasta.library_builder; |
import '../combinator.dart' show Combinator; |
-import '../errors.dart' show InputError, internalError, printUnexpected; |
+import '../errors.dart' show internalError; |
import '../export.dart' show Export; |
@@ -38,14 +38,15 @@ abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder { |
final List<Export> exporters = <Export>[]; |
- final List<InputError> compileTimeErrors = <InputError>[]; |
- |
final Uri fileUri; |
final String relativeFileUri; |
LibraryBuilder partOfLibrary; |
+ /// True if a compile-time error has been reported in this library. |
+ bool hasCompileTimeErrors = false; |
+ |
LibraryBuilder(Uri fileUri, this.scope, this.exports) |
: fileUri = fileUri, |
relativeFileUri = relativizeUri(fileUri), |
@@ -64,13 +65,15 @@ abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder { |
exporters.add(new Export(exporter, this, combinators, charOffset)); |
} |
+ /// See `Loader.addCompileTimeError` for an explanation of the arguments |
+ /// passed to this method. |
+ /// |
+ /// If [fileUri] is null, it defaults to `this.fileUri`. |
void addCompileTimeError(int charOffset, Object message, |
- {Uri fileUri, bool silent: false}) { |
- fileUri ??= this.fileUri; |
- if (!silent) { |
- printUnexpected(fileUri, charOffset, message); |
- } |
- compileTimeErrors.add(new InputError(fileUri, charOffset, message)); |
+ {Uri fileUri, bool silent: false, bool wasHandled: false}) { |
+ hasCompileTimeErrors = true; |
+ loader.addCompileTimeError(fileUri ?? this.fileUri, charOffset, message, |
+ silent: silent, wasHandled: wasHandled); |
} |
void addWarning(int charOffset, Object message, |