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

Unified Diff: pkg/front_end/lib/src/fasta/source/stack_listener.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/source/outline_builder.dart ('k') | pkg/front_end/messages.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/source/stack_listener.dart
diff --git a/pkg/front_end/lib/src/fasta/source/stack_listener.dart b/pkg/front_end/lib/src/fasta/source/stack_listener.dart
index 18cfd42cea03f5112ac42b95364e052fc6245152..63da9fd388df2635c25179ea17a08c4a135c0f1d 100644
--- a/pkg/front_end/lib/src/fasta/source/stack_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/stack_listener.dart
@@ -4,7 +4,7 @@
library fasta.stack_listener;
-import '../fasta_codes.dart' show FastaMessage;
+import '../fasta_codes.dart' show Message;
import '../parser.dart' show Listener, MemberKind;
@@ -238,11 +238,11 @@ abstract class StackListener extends Listener {
}
@override
- void handleRecoverExpression(Token token, FastaMessage message) {
+ void handleRecoverExpression(Token token, Message message) {
debugEvent("RecoverExpression");
}
- void handleExtraneousExpression(Token token, FastaMessage message) {
+ void handleExtraneousExpression(Token token, Message message) {
debugEvent("ExtraneousExpression");
pop(); // Discard the extraneous expression.
}
@@ -258,15 +258,15 @@ abstract class StackListener extends Listener {
}
@override
- void handleRecoverableError(Token token, FastaMessage message) {
+ void handleRecoverableError(Token token, Message message) {
debugEvent("Error: ${message.message}");
- addCompileTimeErrorFromMessage(message);
+ addCompileTimeError(message, token.offset);
}
- void addCompileTimeErrorFromMessage(FastaMessage message);
+ void addCompileTimeError(Message message, int charOffset);
@override
- Token handleUnrecoverableError(Token token, FastaMessage message) {
+ Token handleUnrecoverableError(Token token, Message message) {
throw deprecated_inputError(uri, token.charOffset, message.message);
}
@@ -277,6 +277,10 @@ abstract class StackListener extends Listener {
void deprecated_warning(String message, [int charOffset = -1]) {
messages.deprecated_warning(uri, charOffset, message);
}
+
+ void warning(Message message, int charOffset) {
+ messages.warning(message, charOffset, uri);
+ }
}
class Stack {
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/outline_builder.dart ('k') | pkg/front_end/messages.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698