OLD | NEW |
1 package com.google.dart.compiler.parser; | 1 package com.google.dart.compiler.parser; |
2 | 2 |
3 import com.google.dart.compiler.ErrorCode; | 3 import com.google.dart.compiler.ErrorCode; |
4 import com.google.dart.compiler.ErrorSeverity; | 4 import com.google.dart.compiler.ErrorSeverity; |
5 import com.google.dart.compiler.SubSystem; | 5 import com.google.dart.compiler.SubSystem; |
6 | 6 |
7 /** | 7 /** |
8 * {@link ErrorCode}s for parser. | 8 * {@link ErrorCode}s for parser. |
9 * <p> | 9 * <p> |
10 * The convention in this file (with some exceptions) is that the enumeration na
me matches at least | 10 * The convention in this file (with some exceptions) is that the enumeration na
me matches at least |
11 * the beginning default English translation of the message. | 11 * the beginning default English translation of the message. |
12 */ | 12 */ |
13 public enum ParserErrorCode implements ErrorCode { | 13 public enum ParserErrorCode implements ErrorCode { |
14 ABSTRACT_MEMBER_IN_INTERFACE("Abstract members are not allowed in interfaces")
, | 14 ABSTRACT_MEMBER_IN_INTERFACE("Abstract members are not allowed in interfaces")
, |
15 CATCH_OR_FINALLY_EXPECTED("catch or finally clause expected."), | 15 CATCH_OR_FINALLY_EXPECTED("catch or finally clause expected."), |
16 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_ABSTRACT( | 16 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_ABSTRACT( |
17 "Default values can not be specified in abstract method"), | 17 "Default values can not be specified in abstract method"), |
18 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_CLOSURE( | 18 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_CLOSURE( |
19 "Default values can not be specified in closure parameter"), | 19 "Default values can not be specified in closure parameter"), |
20 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_INTERFACE( | 20 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_INTERFACE( |
21 "Default values can not be specified in signature of an interface method")
, | 21 "Default values can not be specified in signature of an interface method")
, |
22 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_TYPEDEF( | 22 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_TYPEDEF( |
23 "Default values can not be specified in closure type definition"), | 23 "Default values can not be specified in closure type definition"), |
24 DEFAULT_POSITIONAL_PARAMETER("Positional parameters cannot have default values
"), | 24 DEFAULT_POSITIONAL_PARAMETER("Positional parameters cannot have default values
"), |
| 25 DEPRECATED_USE_OF_FACTORY_KEYWORD(ErrorSeverity.WARNING, |
| 26 "Deprecated use of the 'factory' keyword: use 'default' instead"), |
25 DISALLOWED_ABSTRACT_KEYWORD("Abstract keyword not allowed here"), | 27 DISALLOWED_ABSTRACT_KEYWORD("Abstract keyword not allowed here"), |
26 DISALLOWED_FACTORY_KEYWORD("Factory keyword not allowed here"), | 28 DISALLOWED_FACTORY_KEYWORD("Factory keyword not allowed here"), |
27 EXPECTED_ARRAY_OR_MAP_LITERAL("Expected array or map literal"), | 29 EXPECTED_ARRAY_OR_MAP_LITERAL("Expected array or map literal"), |
28 EXPECTED_CASE_OR_DEFAULT("Expected 'case' or 'default'"), | 30 EXPECTED_CASE_OR_DEFAULT("Expected 'case' or 'default'"), |
29 EXPECTED_CLASS_DECLARATION_LBRACE("Expected '{' in class or interface declarat
ion"), | 31 EXPECTED_CLASS_DECLARATION_LBRACE("Expected '{' in class or interface declarat
ion"), |
30 EXPECTED_COMMA_OR_RIGHT_BRACE("Expected ',' or '}'"), | 32 EXPECTED_COMMA_OR_RIGHT_BRACE("Expected ',' or '}'"), |
31 EXPECTED_COMMA_OR_RIGHT_PAREN("Expected ',' or ')', but got '%s'"), | 33 EXPECTED_COMMA_OR_RIGHT_PAREN("Expected ',' or ')', but got '%s'"), |
32 EXPECTED_EOS("Unexpected token '%s' (expected end of file)"), | 34 EXPECTED_EOS("Unexpected token '%s' (expected end of file)"), |
33 EXPECTED_EXTENDS("Expected 'extends'"), | 35 EXPECTED_EXTENDS("Expected 'extends'"), |
34 EXPECTED_IDENTIFIER("Expected identifier"), | 36 EXPECTED_IDENTIFIER("Expected identifier"), |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 96 } |
95 | 97 |
96 public ErrorSeverity getErrorSeverity() { | 98 public ErrorSeverity getErrorSeverity() { |
97 return severity; | 99 return severity; |
98 } | 100 } |
99 | 101 |
100 public SubSystem getSubSystem() { | 102 public SubSystem getSubSystem() { |
101 return SubSystem.PARSER; | 103 return SubSystem.PARSER; |
102 } | 104 } |
103 } | 105 } |
OLD | NEW |