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

Side by Side Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/ParserErrorCode.java

Issue 14811004: Improve error recovery when using 'var' as a type (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 /* 1 /*
2 * Copyright (c) 2012, the Dart project authors. 2 * Copyright (c) 2012, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 "A continue statement in a switch statement must have a label as a target" ), 44 "A continue statement in a switch statement must have a label as a target" ),
45 DIRECTIVE_AFTER_DECLARATION("Directives must appear before any declarations"), 45 DIRECTIVE_AFTER_DECLARATION("Directives must appear before any declarations"),
46 DUPLICATE_LABEL_IN_SWITCH_STATEMENT("The label %s was already used in this swi tch statement"), 46 DUPLICATE_LABEL_IN_SWITCH_STATEMENT("The label %s was already used in this swi tch statement"),
47 DUPLICATED_MODIFIER("The modifier '%s' was already specified."), 47 DUPLICATED_MODIFIER("The modifier '%s' was already specified."),
48 EXPECTED_CASE_OR_DEFAULT("Expected 'case' or 'default'"), 48 EXPECTED_CASE_OR_DEFAULT("Expected 'case' or 'default'"),
49 EXPECTED_CLASS_MEMBER("Expected a class member"), 49 EXPECTED_CLASS_MEMBER("Expected a class member"),
50 EXPECTED_EXECUTABLE("Expected a method, getter, setter or operator declaration "), 50 EXPECTED_EXECUTABLE("Expected a method, getter, setter or operator declaration "),
51 EXPECTED_LIST_OR_MAP_LITERAL("Expected a list or map literal"), 51 EXPECTED_LIST_OR_MAP_LITERAL("Expected a list or map literal"),
52 EXPECTED_STRING_LITERAL("Expected a string literal"), 52 EXPECTED_STRING_LITERAL("Expected a string literal"),
53 EXPECTED_TOKEN("Expected to find '%s'"), 53 EXPECTED_TOKEN("Expected to find '%s'"),
54 EXPECTED_TYPE_NAME("Expected a type name"),
54 EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE("Export directives must preceed part dir ectives"), 55 EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE("Export directives must preceed part dir ectives"),
55 EXTERNAL_AFTER_CONST("The modifier 'external' should be before the modifier 'c onst'"), 56 EXTERNAL_AFTER_CONST("The modifier 'external' should be before the modifier 'c onst'"),
56 EXTERNAL_AFTER_FACTORY("The modifier 'external' should be before the modifier 'factory'"), 57 EXTERNAL_AFTER_FACTORY("The modifier 'external' should be before the modifier 'factory'"),
57 EXTERNAL_AFTER_STATIC("The modifier 'external' should be before the modifier ' static'"), 58 EXTERNAL_AFTER_STATIC("The modifier 'external' should be before the modifier ' static'"),
58 EXTERNAL_CLASS("Classes cannot be declared to be 'external'"), 59 EXTERNAL_CLASS("Classes cannot be declared to be 'external'"),
59 EXTERNAL_CONSTRUCTOR_WITH_BODY("External constructors cannot have a body"), 60 EXTERNAL_CONSTRUCTOR_WITH_BODY("External constructors cannot have a body"),
60 EXTERNAL_FIELD("Fields cannot be declared to be 'external'"), 61 EXTERNAL_FIELD("Fields cannot be declared to be 'external'"),
61 EXTERNAL_GETTER_WITH_BODY("External getters cannot have a body"), 62 EXTERNAL_GETTER_WITH_BODY("External getters cannot have a body"),
62 EXTERNAL_METHOD_WITH_BODY("External methods cannot have a body"), 63 EXTERNAL_METHOD_WITH_BODY("External methods cannot have a body"),
63 EXTERNAL_OPERATOR_WITH_BODY("External operators cannot have a body"), 64 EXTERNAL_OPERATOR_WITH_BODY("External operators cannot have a body"),
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP("There is no '%s' to open a paramete r group"), 144 UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP("There is no '%s' to open a paramete r group"),
144 UNEXPECTED_TOKEN("Unexpected token '%s'"), 145 UNEXPECTED_TOKEN("Unexpected token '%s'"),
145 USE_OF_UNARY_PLUS_OPERATOR("There is no unary plus operator in Dart"), 146 USE_OF_UNARY_PLUS_OPERATOR("There is no unary plus operator in Dart"),
146 WITH_BEFORE_EXTENDS("The extends clause must be before the with clause"), 147 WITH_BEFORE_EXTENDS("The extends clause must be before the with clause"),
147 WITH_WITHOUT_EXTENDS("The with clause cannot be used without an extends clause "), 148 WITH_WITHOUT_EXTENDS("The with clause cannot be used without an extends clause "),
148 WRONG_SEPARATOR_FOR_NAMED_PARAMETER( 149 WRONG_SEPARATOR_FOR_NAMED_PARAMETER(
149 "The default value of a named parameter should be preceeded by ':'"), 150 "The default value of a named parameter should be preceeded by ':'"),
150 WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER( 151 WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER(
151 "The default value of a positional parameter should be preceeded by '='"), 152 "The default value of a positional parameter should be preceeded by '='"),
152 WRONG_TERMINATOR_FOR_PARAMETER_GROUP("Expected '%s' to close parameter group") , 153 WRONG_TERMINATOR_FOR_PARAMETER_GROUP("Expected '%s' to close parameter group") ,
154 VAR_AS_TYPE_NAME("The keyword 'var' cannot be used as a type name"),
153 VAR_CLASS("Classes cannot be declared to be 'var'"), 155 VAR_CLASS("Classes cannot be declared to be 'var'"),
154 VAR_RETURN_TYPE("The return type cannot be 'var'"), 156 VAR_RETURN_TYPE("The return type cannot be 'var'"),
155 VAR_TYPEDEF("Type aliases cannot be declared to be 'var'"), 157 VAR_TYPEDEF("Type aliases cannot be declared to be 'var'"),
156 VOID_PARAMETER("Parameters cannot have a type of 'void'"), 158 VOID_PARAMETER("Parameters cannot have a type of 'void'"),
157 VOID_VARIABLE("Variables cannot have a type of 'void'"); 159 VOID_VARIABLE("Variables cannot have a type of 'void'");
158 160
159 /** 161 /**
160 * The severity of this error. 162 * The severity of this error.
161 */ 163 */
162 private final ErrorSeverity severity; 164 private final ErrorSeverity severity;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 @Override 201 @Override
200 public ErrorType getType() { 202 public ErrorType getType() {
201 return ErrorType.SYNTACTIC_ERROR; 203 return ErrorType.SYNTACTIC_ERROR;
202 } 204 }
203 205
204 @Override 206 @Override
205 public boolean needsRecompilation() { 207 public boolean needsRecompilation() {
206 return true; 208 return true;
207 } 209 }
208 } 210 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698