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

Unified Diff: pkg/compiler/lib/src/scanner/listener.dart

Issue 1248483008: Split MessageKind into a MessageKind key and a MessageTemplate. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 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/compiler/lib/src/io/start_end_information.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/scanner/listener.dart
diff --git a/pkg/compiler/lib/src/scanner/listener.dart b/pkg/compiler/lib/src/scanner/listener.dart
index ef9b651dee4af92af952e4813aa4b7865dcb3173..9df843cf7002ad57656119d7367c3f70a1cd9e5b 100644
--- a/pkg/compiler/lib/src/scanner/listener.dart
+++ b/pkg/compiler/lib/src/scanner/listener.dart
@@ -693,7 +693,8 @@ class Listener {
void reportError(Spannable spannable,
MessageKind messageKind,
[Map arguments = const {}]) {
- String message = messageKind.message(arguments, true).toString();
+ MessageTemplate template = MessageTemplate.TEMPLATES[messageKind];
+ String message = template.message(arguments, true).toString();
Token token;
if (spannable is Token) {
token = spannable;
@@ -1131,8 +1132,8 @@ class ElementListener extends Listener {
} else {
reportFatalError(
token,
- MessageKind.MISSING_TOKEN_BEFORE_THIS.message(
- {'token': string}, true).toString());
+ MessageTemplate.TEMPLATES[MessageKind.MISSING_TOKEN_BEFORE_THIS]
+ .message({'token': string}, true).toString());
}
return skipToEof(token);
}
« no previous file with comments | « pkg/compiler/lib/src/io/start_end_information.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698