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

Unified Diff: pkg/analyzer/lib/src/generated/scanner.dart

Issue 706283002: Fix remaining error code classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/enum_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/scanner.dart
diff --git a/pkg/analyzer/lib/src/generated/scanner.dart b/pkg/analyzer/lib/src/generated/scanner.dart
index 26457d79e9f619dd5f8a1f55fd67fd7675d0a845..3954ce2896175a083c3b6ed164dd8562fc0dbdae 100644
--- a/pkg/analyzer/lib/src/generated/scanner.dart
+++ b/pkg/analyzer/lib/src/generated/scanner.dart
@@ -1870,64 +1870,48 @@ class Scanner {
}
/**
- * The enumeration `ScannerErrorCode` defines the error codes used for errors detected by the
- * scanner.
+ * The enumeration `ScannerErrorCode` defines the error codes used for errors
+ * detected by the scanner.
*/
-class ScannerErrorCode extends Enum<ScannerErrorCode> implements ErrorCode {
- static const ScannerErrorCode ILLEGAL_CHARACTER = const ScannerErrorCode.con1('ILLEGAL_CHARACTER', 0, "Illegal character {0}");
-
- static const ScannerErrorCode MISSING_DIGIT = const ScannerErrorCode.con1('MISSING_DIGIT', 1, "Decimal digit expected");
+class ScannerErrorCode extends ErrorCode {
+ static const ScannerErrorCode ILLEGAL_CHARACTER
+ = const ScannerErrorCode('ILLEGAL_CHARACTER', "Illegal character {0}");
- static const ScannerErrorCode MISSING_HEX_DIGIT = const ScannerErrorCode.con1('MISSING_HEX_DIGIT', 2, "Hexidecimal digit expected");
+ static const ScannerErrorCode MISSING_DIGIT
+ = const ScannerErrorCode('MISSING_DIGIT', "Decimal digit expected");
- static const ScannerErrorCode MISSING_QUOTE = const ScannerErrorCode.con1('MISSING_QUOTE', 3, "Expected quote (' or \")");
+ static const ScannerErrorCode MISSING_HEX_DIGIT
+ = const ScannerErrorCode(
+ 'MISSING_HEX_DIGIT',
+ "Hexidecimal digit expected");
- static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT = const ScannerErrorCode.con1('UNTERMINATED_MULTI_LINE_COMMENT', 4, "Unterminated multi-line comment");
+ static const ScannerErrorCode MISSING_QUOTE
+ = const ScannerErrorCode('MISSING_QUOTE', "Expected quote (' or \")");
- static const ScannerErrorCode UNTERMINATED_STRING_LITERAL = const ScannerErrorCode.con1('UNTERMINATED_STRING_LITERAL', 5, "Unterminated string literal");
+ static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT
+ = const ScannerErrorCode(
+ 'UNTERMINATED_MULTI_LINE_COMMENT',
+ "Unterminated multi-line comment");
- static const List<ScannerErrorCode> values = const [
- ILLEGAL_CHARACTER,
- MISSING_DIGIT,
- MISSING_HEX_DIGIT,
- MISSING_QUOTE,
- UNTERMINATED_MULTI_LINE_COMMENT,
- UNTERMINATED_STRING_LITERAL];
-
- /**
- * The template used to create the message to be displayed for this error.
- */
- final String message;
+ static const ScannerErrorCode UNTERMINATED_STRING_LITERAL
+ = const ScannerErrorCode(
+ 'UNTERMINATED_STRING_LITERAL',
+ "Unterminated string literal");
/**
- * The template used to create the correction to be displayed for this error, or `null` if
- * there is no correction information for this error.
+ * Initialize a newly created error code to have the given [name]. The message
+ * associated with the error will be created from the given [message]
+ * template. The correction associated with the error will be created from the
+ * given [correction] template.
*/
- final String correction;
-
- /**
- * Initialize a newly created error code to have the given message.
- *
- * @param message the message template used to create the message to be displayed for this error
- */
- const ScannerErrorCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
-
- /**
- * Initialize a newly created error code to have the given message and correction.
- *
- * @param message the template used to create the message to be displayed for the error
- * @param correction the template used to create the correction to be displayed for the error
- */
- const ScannerErrorCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
+ const ScannerErrorCode(String name, String message, [String correction])
+ : super(name, message, correction);
@override
ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
@override
ErrorType get type => ErrorType.SYNTACTIC_ERROR;
-
- @override
- String get uniqueName => "$runtimeType.$name";
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/enum_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698