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

Unified Diff: pkg/front_end/tool/_fasta/generate_messages.dart

Issue 2765253002: Report error on only-try block. (Closed)
Patch Set: Created 3 years, 9 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/messages.yaml ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/tool/_fasta/generate_messages.dart
diff --git a/pkg/front_end/tool/_fasta/generate_messages.dart b/pkg/front_end/tool/_fasta/generate_messages.dart
index 41d6162645bdf31b5f5fbf3c948b8b3ebe134074..9c62894d42d5cc164dba6ad98ac3f16d4b420e4c 100644
--- a/pkg/front_end/tool/_fasta/generate_messages.dart
+++ b/pkg/front_end/tool/_fasta/generate_messages.dart
@@ -64,7 +64,7 @@ String compileTemplate(String name, String template, String tip) {
var parameters = new Set<String>();
var conversions = new Set<String>();
var arguments = new Set<String>();
- for (Match match in placeholderPattern.allMatches("$template$tip")) {
+ for (Match match in placeholderPattern.allMatches("$template${tip ?? ''}")) {
switch (match[0]) {
case "#character":
parameters.add("String character");
@@ -93,6 +93,9 @@ String compileTemplate(String name, String template, String tip) {
parameters.add("String string");
arguments.add("'string': string,");
break;
+
+ default:
+ throw "Unhandled placeholder in template: ${match[0]}";
}
}
« no previous file with comments | « pkg/front_end/messages.yaml ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698