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

Unified Diff: pkg/analyzer/lib/source/error_processor.dart

Issue 1541453002: Error code validation updates. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « no previous file | pkg/analyzer/lib/src/task/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/source/error_processor.dart
diff --git a/pkg/analyzer/lib/source/error_processor.dart b/pkg/analyzer/lib/source/error_processor.dart
index b20716a4a5ee7188865e21218365450499d60aba..8e369aad746e50053c249e3447af002741e823fc 100644
--- a/pkg/analyzer/lib/source/error_processor.dart
+++ b/pkg/analyzer/lib/source/error_processor.dart
@@ -54,20 +54,16 @@ class ErrorConfig {
}
}
- ErrorSeverity _toSeverity(String severity) {
- switch (severity) {
- case 'error':
- return ErrorSeverity.ERROR;
- case 'info':
- return ErrorSeverity.INFO;
- case 'warning':
- return ErrorSeverity.WARNING;
- }
- return null;
- }
-
+ ErrorSeverity _toSeverity(String severity) => severityMap[severity];
}
+/// String identifiers mapped to associated severities.
+const Map<String, ErrorSeverity> severityMap = const {
+ 'error': ErrorSeverity.ERROR,
+ 'info': ErrorSeverity.INFO,
+ 'warning': ErrorSeverity.WARNING
+};
+
/// Process errors by filtering or changing associated [ErrorSeverity].
class ErrorProcessor {
/// The code name of the associated error.
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698