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

Unified Diff: pkg/front_end/lib/src/fasta/builder/library_builder.dart

Issue 2965393002: Use FastaMessage instead of String. Part 1. (Closed)
Patch Set: Add type variable to Code. Created 3 years, 5 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/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 6e0aa2e178056f3537156b339d6c893b942e36e0..5cc3cde1f16e2799903619763bcedc70db4f2249 100644
--- a/pkg/front_end/lib/src/fasta/builder/library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/library_builder.dart
@@ -12,7 +12,8 @@ import '../export.dart' show Export;
import '../loader.dart' show Loader;
-import '../messages.dart' show deprecated_nit, deprecated_warning;
+import '../messages.dart'
+ show Message, deprecated_nit, deprecated_warning, nit, warning;
import '../util/relativize.dart' show relativizeUri;
@@ -77,6 +78,26 @@ abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder {
silent: silent, wasHandled: wasHandled);
}
+ void addCompileTimeError(Message message, int charOffset, Uri uri,
+ {bool silent: false, bool wasHandled: false}) {
+ hasCompileTimeErrors = true;
+ loader.addCompileTimeError(message, charOffset, uri,
+ silent: silent, wasHandled: wasHandled);
+ }
+
+ void addWarning(Message message, int charOffset, Uri uri,
+ {bool silent: false}) {
+ if (!silent) {
+ warning(message, charOffset, uri);
+ }
+ }
+
+ void addNit(Message message, int charOffset, Uri uri, {bool silent: false}) {
+ if (!silent) {
+ nit(message, charOffset, uri);
+ }
+ }
+
void deprecated_addWarning(int charOffset, Object message,
{Uri fileUri, bool silent: false}) {
fileUri ??= this.fileUri;
« no previous file with comments | « pkg/front_end/lib/src/fasta/builder/constructor_reference_builder.dart ('k') | pkg/front_end/lib/src/fasta/command_line.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698