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

Unified Diff: pkg/front_end/lib/src/fasta/loader.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
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_target.dart ('k') | pkg/front_end/lib/src/fasta/messages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/loader.dart
diff --git a/pkg/front_end/lib/src/fasta/loader.dart b/pkg/front_end/lib/src/fasta/loader.dart
index ed576aa07c5b9977983fb3177cbb1cf1e727e294..273f1a50312a33b6f3d3fa50fe64513a1e04ab00 100644
--- a/pkg/front_end/lib/src/fasta/loader.dart
+++ b/pkg/front_end/lib/src/fasta/loader.dart
@@ -11,7 +11,9 @@ import 'dart:collection' show Queue;
import 'builder/builder.dart' show Builder, LibraryBuilder;
import 'deprecated_problems.dart'
- show deprecated_InputError, firstSourceUri, deprecated_printUnexpected;
+ show firstSourceUri, deprecated_printUnexpected;
+
+import 'messages.dart' show LocatedMessage, Message, templateUnspecified;
import 'target_implementation.dart' show TargetImplementation;
@@ -31,14 +33,14 @@ abstract class Loader<L> {
///
/// A handled error is an error that has been added to the generated AST
/// already, for example, as a throw expression.
- final List<deprecated_InputError> handledErrors = <deprecated_InputError>[];
+ final List<LocatedMessage> handledErrors = <LocatedMessage>[];
/// List of all unhandled compile-time errors seen so far by libraries loaded
/// by this loader.
///
/// An unhandled error is an error that hasn't been handled, see
/// [handledErrors].
- final List<deprecated_InputError> unhandledErrors = <deprecated_InputError>[];
+ final List<LocatedMessage> unhandledErrors = <LocatedMessage>[];
LibraryBuilder coreLibrary;
@@ -165,14 +167,24 @@ ${format(ms / libraryCount, 3, 12)} ms/compilation unit.""");
///
/// If [wasHandled] is true, this error is added to [handledErrors],
/// otherwise it is added to [unhandledErrors].
+ void addCompileTimeError(Message message, int charOffset, Uri fileUri,
+ {bool silent: false, bool wasHandled: false}) {
+ if (!silent) {
+ deprecated_printUnexpected(fileUri, charOffset, message.message);
+ }
+ (wasHandled ? handledErrors : unhandledErrors)
+ .add(message.withLocation(fileUri, charOffset));
+ }
+
void deprecated_addCompileTimeError(
- Uri fileUri, int charOffset, Object message,
+ Uri fileUri, int charOffset, String message,
{bool silent: false, bool wasHandled: false}) {
if (!silent) {
deprecated_printUnexpected(fileUri, charOffset, message);
}
- (wasHandled ? handledErrors : unhandledErrors)
- .add(new deprecated_InputError(fileUri, charOffset, message));
+ (wasHandled ? handledErrors : unhandledErrors).add(templateUnspecified
+ .withArguments(message)
+ .withLocation(fileUri, charOffset));
}
Builder getAbstractClassInstantiationError() {
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_target.dart ('k') | pkg/front_end/lib/src/fasta/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698