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

Unified Diff: pkg/front_end/lib/src/fasta/parser/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
Index: pkg/front_end/lib/src/fasta/parser/listener.dart
diff --git a/pkg/front_end/lib/src/fasta/parser/listener.dart b/pkg/front_end/lib/src/fasta/parser/listener.dart
index 503f00f7c88cbd4e4d8ad6d1aa996d2a82011096..074c49e10bde63b93ab1bb15b4db7a7441602fe3 100644
--- a/pkg/front_end/lib/src/fasta/parser/listener.dart
+++ b/pkg/front_end/lib/src/fasta/parser/listener.dart
@@ -4,7 +4,7 @@
library fasta.parser.listener;
-import '../fasta_codes.dart' show FastaMessage;
+import '../fasta_codes.dart' show Message;
import '../../scanner/token.dart' show BeginToken, Token, TokenType;
@@ -173,14 +173,14 @@ class Listener {
/// Called by [ClassMemberParser] after skipping an expression as error
/// recovery. For a stack-based listener, the suggested action is to push
/// `null` or a synthetic erroneous expression.
- void handleRecoverExpression(Token token, FastaMessage message) {
+ void handleRecoverExpression(Token token, Message message) {
logEvent("RecoverExpression");
}
/// Called by [Parser] after parsing an extraneous expression as error
/// recovery. For a stack-based listener, the suggested action is to discard
/// an expression from the stack.
- void handleExtraneousExpression(Token token, FastaMessage message) {
+ void handleExtraneousExpression(Token token, Message message) {
logEvent("ExtraneousExpression");
}
@@ -1033,12 +1033,12 @@ class Listener {
/// `null`. In the latter case, the parser simply skips to EOF which will
/// often result in additional parser errors as the parser returns from its
/// recursive state.
- Token handleUnrecoverableError(Token token, FastaMessage message) {
+ Token handleUnrecoverableError(Token token, Message message) {
throw new ParserError.fromTokens(token, token, message);
}
/// The parser noticed a syntax error, but was able to recover from it.
- void handleRecoverableError(Token token, FastaMessage message) {
+ void handleRecoverableError(Token token, Message message) {
recoverableErrors.add(new ParserError.fromTokens(token, token, message));
}
@@ -1089,11 +1089,11 @@ class ParserError {
/// Character offset from the beginning of file where this error ends.
final int endOffset;
- final FastaMessage message;
+ final Message message;
ParserError(this.beginOffset, this.endOffset, this.message);
- ParserError.fromTokens(Token begin, Token end, FastaMessage message)
+ ParserError.fromTokens(Token begin, Token end, Message message)
: this(begin.charOffset, end.charOffset + end.charCount, message);
String toString() => "@${beginOffset}: ${message.message}\n${message.tip}";
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/class_member_parser.dart ('k') | pkg/front_end/lib/src/fasta/parser/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698