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

Side by Side Diff: compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java

Issue 10541018: Fix for issue 1399 (and minor error message clean-up) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.parser; 5 package com.google.dart.compiler.parser;
6 6
7 import com.google.dart.compiler.ErrorCode; 7 import com.google.dart.compiler.ErrorCode;
8 import com.google.dart.compiler.ErrorSeverity; 8 import com.google.dart.compiler.ErrorSeverity;
9 import com.google.dart.compiler.SubSystem; 9 import com.google.dart.compiler.SubSystem;
10 10
11 /** 11 /**
12 * {@link ErrorCode}s for parser. 12 * {@link ErrorCode}s for parser.
13 * <p> 13 * <p>
14 * The convention in this file (with some exceptions) is that the enumeration na me matches at least 14 * The convention in this file (with some exceptions) is that the enumeration na me matches at least
15 * the beginning default English translation of the message. 15 * the beginning default English translation of the message.
16 */ 16 */
17 public enum ParserErrorCode implements ErrorCode { 17 public enum ParserErrorCode implements ErrorCode {
18 ABSTRACT_MEMBER_IN_INTERFACE("Abstract members are not allowed in interfaces") , 18 ABSTRACT_MEMBER_IN_INTERFACE("Abstract members are not allowed in interfaces") ,
19 ABSTRACT_METHOD_WITH_BODY("Abstract method can not have a body"), 19 ABSTRACT_METHOD_WITH_BODY("Abstract method cannot have a body"),
20 ABSTRACT_TOP_LEVEL_ELEMENT("Only class can be abstract top-level element"), 20 ABSTRACT_TOP_LEVEL_ELEMENT("Only class can be abstract top-level element"),
21 CATCH_OR_FINALLY_EXPECTED("catch or finally clause expected."), 21 CATCH_OR_FINALLY_EXPECTED("catch or finally clause expected."),
22 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_ABSTRACT( 22 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_ABSTRACT(
23 "Default values can not be specified in abstract method"), 23 "Default values cannot be specified in abstract method"),
24 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_CLOSURE( 24 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_CLOSURE(
25 "Default values can not be specified in closure parameter"), 25 "Default values cannot be specified in closure parameter"),
26 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_INTERFACE( 26 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_INTERFACE(
27 "Default values can not be specified in signature of an interface method") , 27 "Default values cannot be specified in signature of an interface method"),
28 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_TYPEDEF( 28 DEFAULT_VALUE_CAN_NOT_BE_SPECIFIED_IN_TYPEDEF(
29 "Default values can not be specified in closure type definition"), 29 "Default values cannot be specified in closure type definition"),
30 DEFAULT_POSITIONAL_PARAMETER("Positional parameters cannot have default values "), 30 DEFAULT_POSITIONAL_PARAMETER("Positional parameters cannot have default values "),
31 DEPRECATED_USE_OF_FACTORY_KEYWORD("Deprecated use of the 'factory' keyword: us e 'default' instead"), 31 DEPRECATED_USE_OF_FACTORY_KEYWORD("Deprecated use of the 'factory' keyword: us e 'default' instead"),
32 DIRECTIVE_OUT_OF_ORDER("Directive out of order"), 32 DIRECTIVE_OUT_OF_ORDER("Directive out of order"),
33 DISALLOWED_ABSTRACT_KEYWORD("Abstract keyword not allowed here"), 33 DISALLOWED_ABSTRACT_KEYWORD("Abstract keyword not allowed here"),
34 DISALLOWED_FACTORY_KEYWORD("Factory keyword not allowed here"), 34 DISALLOWED_FACTORY_KEYWORD("Factory keyword not allowed here"),
35 EXPECTED_ARRAY_OR_MAP_LITERAL("Expected array or map literal"), 35 EXPECTED_ARRAY_OR_MAP_LITERAL("Expected array or map literal"),
36 EXPECTED_CASE_OR_DEFAULT("Expected 'case' or 'default'"), 36 EXPECTED_CASE_OR_DEFAULT("Expected 'case' or 'default'"),
37 EXPECTED_CLASS_DECLARATION_LBRACE("Expected '{' in class or interface declarat ion"), 37 EXPECTED_CLASS_DECLARATION_LBRACE("Expected '{' in class or interface declarat ion"),
38 EXPECTED_COMMA_OR_RIGHT_BRACE("Expected ',' or '}'"), 38 EXPECTED_COMMA_OR_RIGHT_BRACE("Expected ',' or '}'"),
39 EXPECTED_COMMA_OR_RIGHT_PAREN("Expected ',' or ')', but got '%s'"), 39 EXPECTED_COMMA_OR_RIGHT_PAREN("Expected ',' or ')', but got '%s'"),
(...skipping 20 matching lines...) Expand all
60 FINAL_IS_NOT_ALLOWED_ON_A_METHOD_DEFINITION("'final' is not allowed on a metho d definition"), 60 FINAL_IS_NOT_ALLOWED_ON_A_METHOD_DEFINITION("'final' is not allowed on a metho d definition"),
61 FOR_IN_WITH_COMPLEX_VARIABLE("Only simple variables can be assigned to in a fo r-in construct"), 61 FOR_IN_WITH_COMPLEX_VARIABLE("Only simple variables can be assigned to in a fo r-in construct"),
62 FOR_IN_WITH_MULTIPLE_VARIABLES("Too many variable declarations in a for-in con struct"), 62 FOR_IN_WITH_MULTIPLE_VARIABLES("Too many variable declarations in a for-in con struct"),
63 FOR_IN_WITH_VARIABLE_INITIALIZER("Cannot initialize for-in variables"), 63 FOR_IN_WITH_VARIABLE_INITIALIZER("Cannot initialize for-in variables"),
64 FUNCTION_TYPED_PARAMETER_IS_FINAL("Formal parameter with a function type canno t be const"), 64 FUNCTION_TYPED_PARAMETER_IS_FINAL("Formal parameter with a function type canno t be const"),
65 FUNCTION_TYPED_PARAMETER_IS_VAR("Formal parameter with a function type cannot be var"), 65 FUNCTION_TYPED_PARAMETER_IS_VAR("Formal parameter with a function type cannot be var"),
66 FUNCTION_NAME_EXPECTED_IDENTIFIER("Function name expected to be an identifier" ), 66 FUNCTION_NAME_EXPECTED_IDENTIFIER("Function name expected to be an identifier" ),
67 ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE("Illegal assignment to non-assignable exp ression"), 67 ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE("Illegal assignment to non-assignable exp ression"),
68 ILLEGAL_NUMBER_OF_PARAMETERS("Illegal number of parameters"), 68 ILLEGAL_NUMBER_OF_PARAMETERS("Illegal number of parameters"),
69 INCOMPLETE_STRING_LITERAL("Incomplete string literal"), 69 INCOMPLETE_STRING_LITERAL("Incomplete string literal"),
70 INTERFACE_METHOD_WITH_BODY("Interface method can not have a body"), 70 INTERFACE_METHOD_WITH_BODY("Interface method cannot have a body"),
71 INVALID_FIELD_DECLARATION("Wrong syntax for field declaration"), 71 INVALID_FIELD_DECLARATION("Wrong syntax for field declaration"),
72 INVALID_IDENTIFIER("The token '%s' cannot be used as an identifier"), 72 INVALID_IDENTIFIER("The token '%s' cannot be used as an identifier"),
73 INVALID_OPERATOR_CHAINING("Cannot chain '%s'"), 73 INVALID_OPERATOR_CHAINING("Cannot chain '%s'"),
74 LOCAL_CANNOT_BE_STATIC("Local function can not be static"), 74 LOCAL_CANNOT_BE_STATIC("Local function cannot be static"),
75 MISSING_FUNCTION_NAME("a function name is required for a declaration"), 75 MISSING_FUNCTION_NAME("a function name is required for a declaration"),
76 NAMED_PARAMETER_NOT_ALLOWED("Named parameter is not allowed for operator or se tter method"), 76 NAMED_PARAMETER_NOT_ALLOWED("Named parameter is not allowed for operator or se tter method"),
77 NO_SPACE_AFTER_PLUS("Cannot have space between plus and numeric literal"),
77 NO_UNARY_PLUS_OPERATOR("No unary plus operator in Dart"), 78 NO_UNARY_PLUS_OPERATOR("No unary plus operator in Dart"),
78 NON_FINAL_STATIC_MEMBER_IN_INTERFACE("Non-final static members are not allowed in interfaces"), 79 NON_FINAL_STATIC_MEMBER_IN_INTERFACE("Non-final static members are not allowed in interfaces"),
79 ONLY_ONE_LIBRARY_DIRECTIVE("Only one library directive may be declared in a fi le"), 80 ONLY_ONE_LIBRARY_DIRECTIVE("Only one library directive may be declared in a fi le"),
80 OPERATOR_CANNOT_BE_STATIC("Operators cannot be static"), 81 OPERATOR_CANNOT_BE_STATIC("Operators cannot be static"),
81 OPERATOR_IS_NOT_USER_DEFINABLE("Operator is not user definable"), 82 OPERATOR_IS_NOT_USER_DEFINABLE("Operator is not user definable"),
82 POSITIONAL_AFTER_NAMED_ARGUMENT("Positional argument after named argument"), 83 POSITIONAL_AFTER_NAMED_ARGUMENT("Positional argument after named argument"),
83 REDIRECTING_CONSTRUCTOR_PARAM("Redirecting constructor can not have initialize rs"), 84 REDIRECTING_CONSTRUCTOR_PARAM("Redirecting constructor cannot have initializer s"),
84 REDIRECTING_CONSTRUCTOR_ITSELF("Redirecting constructor can not have initializ ers"), 85 REDIRECTING_CONSTRUCTOR_ITSELF("Redirecting constructor cannot have initialize rs"),
85 REDIRECTING_CONSTRUCTOR_MULTIPLE("Multiple redirecting constructor invocations "), 86 REDIRECTING_CONSTRUCTOR_MULTIPLE("Multiple redirecting constructor invocations "),
86 REDIRECTING_CONSTRUCTOR_OTHER("Redirecting constructor can not have initialize rs"), 87 REDIRECTING_CONSTRUCTOR_OTHER("Redirecting constructor cannot have initializer s"),
87 SUPER_CONSTRUCTOR_MULTIPLE("'super' must be called only once in the initializa tion list"), 88 SUPER_CONSTRUCTOR_MULTIPLE("'super' must be called only once in the initializa tion list"),
88 SUPER_CANNOT_BE_USED_AS_THE_SECOND_OPERAND( 89 SUPER_CANNOT_BE_USED_AS_THE_SECOND_OPERAND(
89 "'super' cannot be used as the second operand in a binary expression."), 90 "'super' cannot be used as the second operand in a binary expression."),
90 SUPER_IS_NOT_VALID_AS_A_BOOLEAN_OPERAND("'super' is not valid as a boolean ope rand"), 91 SUPER_IS_NOT_VALID_AS_A_BOOLEAN_OPERAND("'super' is not valid as a boolean ope rand"),
91 SUPER_IS_NOT_VALID_ALONE_OR_AS_A_BOOLEAN_OPERAND( 92 SUPER_IS_NOT_VALID_ALONE_OR_AS_A_BOOLEAN_OPERAND(
92 "'super' is not valid alone or as a boolean operand"), 93 "'super' is not valid alone or as a boolean operand"),
93 TOP_LEVEL_CANNOT_BE_STATIC("Top-level field or method can not be static"), 94 TOP_LEVEL_CANNOT_BE_STATIC("Top-level field or method cannot be static"),
94 UNEXPECTED_TOKEN("Unexpected token '%s'"), 95 UNEXPECTED_TOKEN("Unexpected token '%s'"),
95 UNEXPECTED_TOKEN_IN_STRING_INTERPOLATION("Unexpected token in string interpola tion: %s"), 96 UNEXPECTED_TOKEN_IN_STRING_INTERPOLATION("Unexpected token in string interpola tion: %s"),
96 UNEXPECTED_TYPE_ARGUMENT("unexpected type argument"), 97 UNEXPECTED_TYPE_ARGUMENT("unexpected type argument"),
97 VAR_IS_NOT_ALLOWED_ON_A_METHOD_DEFINITION("'var' is not allowed on a method de finition"), 98 VAR_IS_NOT_ALLOWED_ON_A_METHOD_DEFINITION("'var' is not allowed on a method de finition"),
98 VOID_FIELD("Field cannot be of type void"), 99 VOID_FIELD("Field cannot be of type void"),
99 VOID_PARAMETER("Parameter cannot be of type void"); 100 VOID_PARAMETER("Parameter cannot be of type void");
100 101
101 private final ErrorSeverity severity; 102 private final ErrorSeverity severity;
102 private final String message; 103 private final String message;
103 104
(...skipping 25 matching lines...) Expand all
129 @Override 130 @Override
130 public SubSystem getSubSystem() { 131 public SubSystem getSubSystem() {
131 return SubSystem.PARSER; 132 return SubSystem.PARSER;
132 } 133 }
133 134
134 @Override 135 @Override
135 public boolean needsRecompilation() { 136 public boolean needsRecompilation() {
136 return true; 137 return true;
137 } 138 }
138 } 139 }
OLDNEW
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/ParserContext.java ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698