OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 package com.google.dart.compiler; | 5 package com.google.dart.compiler; |
6 | 6 |
7 /** | 7 /** |
8 * Valid error codes for the errors produced by the Dart compiler. | 8 * Valid error codes for the errors produced by the Dart compiler. |
9 */ | 9 */ |
10 public enum DartCompilerErrorCode implements ErrorCode { | 10 public enum DartCompilerErrorCode implements ErrorCode { |
(...skipping 21 matching lines...) Expand all Loading... |
32 CANNOT_RESOLVE_FIELD("cannot resolve field %s"), | 32 CANNOT_RESOLVE_FIELD("cannot resolve field %s"), |
33 CANNOT_RESOLVE_LABEL("cannot resolve label %s"), | 33 CANNOT_RESOLVE_LABEL("cannot resolve label %s"), |
34 CANNOT_RESOLVE_METHOD("cannot resolve method %s"), | 34 CANNOT_RESOLVE_METHOD("cannot resolve method %s"), |
35 CANNOT_RESOLVE_SUPER_CONSTRUCTOR("cannot resolve method %s"), | 35 CANNOT_RESOLVE_SUPER_CONSTRUCTOR("cannot resolve method %s"), |
36 CANNOT_RESOLVE_IMPLICIT_CALL_TO_SUPER_CONSTRUCTOR( | 36 CANNOT_RESOLVE_IMPLICIT_CALL_TO_SUPER_CONSTRUCTOR( |
37 "super type %s does not have a default constructor"), | 37 "super type %s does not have a default constructor"), |
38 CATCH_OR_FINALLY_EXPECTED("catch or finally clause expected."), | 38 CATCH_OR_FINALLY_EXPECTED("catch or finally clause expected."), |
39 CONSTRUCTOR_CANNOT_BE_ABSTRACT("A constructor cannot be asbstract"), | 39 CONSTRUCTOR_CANNOT_BE_ABSTRACT("A constructor cannot be asbstract"), |
40 CONSTRUCTOR_CANNOT_BE_STATIC("A constructor cannot be static"), | 40 CONSTRUCTOR_CANNOT_BE_STATIC("A constructor cannot be static"), |
41 CONSTRUCTOR_MUST_CALL_SUPER("Constructors must call super constructor"), | 41 CONSTRUCTOR_MUST_CALL_SUPER("Constructors must call super constructor"), |
42 CONST_CONSTRUCTOR_CANNOT_HAVE_BODY("A cconst onstructor cannot have a body"), | 42 CONST_CONSTRUCTOR_CANNOT_HAVE_BODY("A const constructor cannot have a body"), |
43 CONST_CONSTRUCTOR_MUST_CALL_CONST_SUPER("const constructor must call const sup
er constructor"), | 43 CONST_CONSTRUCTOR_MUST_CALL_CONST_SUPER("const constructor must call const sup
er constructor"), |
44 CONSTANTS_MUST_BE_INITIALIZED("constants must be initialized"), | 44 CONSTANTS_MUST_BE_INITIALIZED("constants must be initialized"), |
45 CYCLIC_CLASS("%s causes a cycle in the supertype graph"), | 45 CYCLIC_CLASS("%s causes a cycle in the supertype graph"), |
46 DEFAULT_POSITIONAL_PARAMETER("Positional parameters cannot have default values
"), | 46 DEFAULT_POSITIONAL_PARAMETER("Positional parameters cannot have default values
"), |
47 DID_YOU_MEAN_NEW("%1$s is a %2$s. Did you mean (new %1$s)?"), | 47 DID_YOU_MEAN_NEW("%1$s is a %2$s. Did you mean (new %1$s)?"), |
48 DISALLOWED_ABSTRACT_KEYWORD("SyntaxError: abstract keyword not allowed here"), | 48 DISALLOWED_ABSTRACT_KEYWORD("SyntaxError: abstract keyword not allowed here"), |
49 DISALLOWED_FACTORY_KEYWORD("SyntaxError: factory keyword not allowed here"), | 49 DISALLOWED_FACTORY_KEYWORD("SyntaxError: factory keyword not allowed here"), |
50 DUPLICATE_DEFINITION("duplicate definition of %s"), | 50 DUPLICATE_DEFINITION("duplicate definition of %s"), |
51 DUPLICATED_INTERFACE("%s and %s are duplicated in the supertype graph"), | 51 DUPLICATED_INTERFACE("%s and %s are duplicated in the supertype graph"), |
52 ENTRY_POINT_IN_LIBRARY("Libraries may not specify an entry point"), | 52 ENTRY_POINT_IN_LIBRARY("Libraries may not specify an entry point"), |
53 ENTRY_POINT_METHOD_CANNOT_HAVE_PARAMETERS("Main entry point method cannot have
parameters"), | 53 ENTRY_POINT_METHOD_CANNOT_HAVE_PARAMETERS("Main entry point method cannot have
parameters"), |
54 ENTRY_POINT_METHOD_MAY_NOT_BE_GETTER("Entry point \"%s\" may not be a getter")
, | 54 ENTRY_POINT_METHOD_MAY_NOT_BE_GETTER("Entry point \"%s\" may not be a getter")
, |
55 ENTRY_POINT_METHOD_MAY_NOT_BE_SETTER("Entry point \"%s\" may not be a setter")
, | 55 ENTRY_POINT_METHOD_MAY_NOT_BE_SETTER("Entry point \"%s\" may not be a setter")
, |
56 EXPECTED_AN_INSTANCE_FIELD_IN_SUPER_CLASS( | 56 EXPECTED_AN_INSTANCE_FIELD_IN_SUPER_CLASS( |
57 "expected an instance field in the super class, but got %s"), | 57 "expected an instance field in the super class, but got %s"), |
58 EXPECTED_ARRAY_OR_MAP_LITERAL("Expected array or map literal"), | 58 EXPECTED_ARRAY_OR_MAP_LITERAL("Expected array or map literal"), |
59 EXPECTED_CASE_OR_DEFAULT("Expected 'case' or 'default'"), | 59 EXPECTED_CASE_OR_DEFAULT("Expected 'case' or 'default'"), |
60 EXPECTED_COMMA_OR_RIGHT_BRACE("Expected ',' or '}'"), | 60 EXPECTED_COMMA_OR_RIGHT_BRACE("Expected ',' or '}'"), |
61 EXPECTED_COMMA_OR_RIGHT_PAREN("Expected ',' or ')', but got '%s'"), | 61 EXPECTED_COMMA_OR_RIGHT_PAREN("Expected ',' or ')', but got '%s'"), |
62 EXPECTED_COMPOUND_STATEMENT("SyntaxError: expected if, switch, while, do, or f
or"), | 62 EXPECTED_COMPOUND_STATEMENT("SyntaxError: expected if, switch, while, do, or f
or"), |
| 63 EXPECTED_CONSTANT_EXPRESSION("Expected constant expression"), |
| 64 EXPECTED_CONSTANT_EXPRESSION_BOOLEAN("Expected constant expression of type boo
l, got %s"), |
| 65 EXPECTED_CONSTANT_EXPRESSION_INT("Expected constant expression of type int, go
t %s"), |
| 66 EXPECTED_CONSTANT_EXPRESSION_NUMBER("Expected constant expression of type num,
got %s"), |
| 67 EXPECTED_CONSTANT_EXPRESSION_STRING_NUMBER_BOOL( |
| 68 "Expected constant expression of type String, num or bool, got %s"), |
63 EXPECTED_CONSTANT_LITERAL("Expected a constant literal"), | 69 EXPECTED_CONSTANT_LITERAL("Expected a constant literal"), |
64 EXPECTED_EOS("Unexpected token '%s' (expected end of file)"), | 70 EXPECTED_EOS("Unexpected token '%s' (expected end of file)"), |
65 EXPECTED_FIELD_NOT_CLASS("%s is a class, expected a local field"), | 71 EXPECTED_FIELD_NOT_CLASS("%s is a class, expected a local field"), |
66 EXPECTED_FIELD_NOT_METHOD("%s is a method, expected a local field"), | 72 EXPECTED_FIELD_NOT_METHOD("%s is a method, expected a local field"), |
67 EXPECTED_FIELD_NOT_PARAMETER("%s is a parameter, expected a local field"), | 73 EXPECTED_FIELD_NOT_PARAMETER("%s is a parameter, expected a local field"), |
68 EXPECTED_FIELD_NOT_TYPE_VAR("%s is a type variable, expected a local field"), | 74 EXPECTED_FIELD_NOT_TYPE_VAR("%s is a type variable, expected a local field"), |
69 EXPECTED_IDENTIFIER("Expected identifier"), | 75 EXPECTED_IDENTIFIER("Expected identifier"), |
70 EXPECTED_ONE_ARGUMENT("Expected one argument"), | 76 EXPECTED_ONE_ARGUMENT("Expected one argument"), |
71 EXPECTED_LEFT_BRACKET_OR_LEFT_BRACE("'[' or '{' expected"), | 77 EXPECTED_LEFT_BRACKET_OR_LEFT_BRACE("'[' or '{' expected"), |
72 EXPECTED_LEFT_PAREN("'(' expected"), | 78 EXPECTED_LEFT_PAREN("'(' expected"), |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 */ | 218 */ |
213 private DartCompilerErrorCode(String message) { | 219 private DartCompilerErrorCode(String message) { |
214 this.message = message; | 220 this.message = message; |
215 } | 221 } |
216 | 222 |
217 @Override | 223 @Override |
218 public String getMessage() { | 224 public String getMessage() { |
219 return message; | 225 return message; |
220 } | 226 } |
221 } | 227 } |
OLD | NEW |