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

Unified Diff: pkg/front_end/lib/src/fasta/command_line.dart

Issue 2970273004: Deprecate all diagnostics methods that use strings. (Closed)
Patch Set: Merged with 4df146dd9a465d63344330bf3e45524b927c92ec 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/command_line.dart
diff --git a/pkg/front_end/lib/src/fasta/command_line.dart b/pkg/front_end/lib/src/fasta/command_line.dart
index 643bd923912c08a343f1cab33dd9fc4ebcb371f2..8916a45693b07e44fe1bddb40d7015475c324fdb 100644
--- a/pkg/front_end/lib/src/fasta/command_line.dart
+++ b/pkg/front_end/lib/src/fasta/command_line.dart
@@ -4,11 +4,12 @@
library fasta.command_line;
-import 'errors.dart' show inputError, internalError;
+import 'deprecated_problems.dart'
+ show deprecated_inputError, deprecated_internalProblem;
-argumentError(String usage, String message) {
+deprecated_argumentError(String usage, String message) {
if (usage != null) print(usage);
- inputError(null, null, message);
+ deprecated_inputError(null, null, message);
}
class ParsedArguments {
@@ -88,7 +89,8 @@ class CommandLine {
String value;
if (valueSpecification != null) {
if (!iterator.moveNext()) {
- return argumentError(usage, "Expected value after '$argument'.");
+ return deprecated_argumentError(
+ usage, "Expected value after '$argument'.");
}
value = iterator.current;
} else {
@@ -101,13 +103,13 @@ class CommandLine {
}
if (valueSpecification == null) {
if (value != null) {
- return argumentError(
+ return deprecated_argumentError(
usage, "Argument '$argument' doesn't take a value: '$value'.");
}
result.options[argument] = true;
} else {
if (valueSpecification is! String && valueSpecification is! Type) {
- return argumentError(
+ return deprecated_argumentError(
usage,
"Unrecognized type of value "
"specification: ${valueSpecification.runtimeType}.");
@@ -124,7 +126,7 @@ class CommandLine {
case "String":
case "Uri":
if (result.options.containsKey(argument)) {
- return argumentError(
+ return deprecated_argumentError(
usage,
"Multiple values for '$argument': "
"'${result.options[argument]}' and '$value'.");
@@ -132,7 +134,7 @@ class CommandLine {
var parsedValue;
if (valueSpecification == int) {
parsedValue = int.parse(value, onError: (_) {
- return argumentError(
+ return deprecated_argumentError(
usage, "Value for '$argument', '$value', isn't an int.");
});
} else if (valueSpecification == bool) {
@@ -141,7 +143,7 @@ class CommandLine {
} else if (value == "false" || value == "no") {
parsedValue = false;
} else {
- return argumentError(
+ return deprecated_argumentError(
usage,
"Value for '$argument' is '$value', "
"but expected one of: 'true', 'false', 'yes', or 'no'.");
@@ -151,19 +153,19 @@ class CommandLine {
} else if (valueSpecification == String) {
parsedValue = value;
} else if (valueSpecification is String) {
- return argumentError(
+ return deprecated_argumentError(
usage,
"Unrecognized value specification: "
"'$valueSpecification', try using a type literal instead.");
} else {
// All possible cases should have been handled above.
- return internalError("assertion failure");
+ return deprecated_internalProblem("assertion failure");
}
result.options[argument] = parsedValue;
break;
default:
- return argumentError(usage,
+ return deprecated_argumentError(usage,
"Unrecognized value specification: '$valueSpecification'.");
}
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/builder/mixin_application_builder.dart ('k') | pkg/front_end/lib/src/fasta/compile_platform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698