OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library analyzer.error.error; | 5 library analyzer.error.error; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
10 import 'package:analyzer/error/listener.dart'; | 10 import 'package:analyzer/error/listener.dart'; |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 */ | 291 */ |
292 abstract class ErrorCode { | 292 abstract class ErrorCode { |
293 /** | 293 /** |
294 * Engine error code values. | 294 * Engine error code values. |
295 */ | 295 */ |
296 static const List<ErrorCode> values = const [ | 296 static const List<ErrorCode> values = const [ |
297 // | 297 // |
298 // Manually generated. You can mostly reproduce this list by running the | 298 // Manually generated. You can mostly reproduce this list by running the |
299 // following command from the root of the analyzer package: | 299 // following command from the root of the analyzer package: |
300 // | 300 // |
301 // > cat lib/src/dart/error/syntactic_errors.dart src/error/codes.dart | | 301 // > cat |
| 302 // lib/src/analysis_options/error/option_codes.dart'; |
| 303 // lib/src/dart/error/hint_codes.dart'; |
| 304 // lib/src/dart/error/lint_codes.dart'; |
| 305 // lib/src/dart/error/todo_codes.dart'; |
| 306 // lib/src/html/error/html_codes.dart'; |
| 307 // lib/src/dart/error/syntactic_errors.dart |
| 308 // lib/src/error/codes.dart | |
302 // grep 'static const .*Code' | | 309 // grep 'static const .*Code' | |
303 // awk '{print $3"."$4","}' | | 310 // awk '{print $3"."$4","}' | |
304 // sort > codes.txt | 311 // sort > codes.txt |
305 // | 312 // |
306 // There are a few error codes that are wrapped such that the name of the | 313 // There are a few error codes that are wrapped such that the name of the |
307 // error code in on the line following the pattern we're grepping for. Those | 314 // error code in on the line following the pattern we're grepping for. Those |
308 // need to be filled in by hand. | 315 // need to be filled in by hand. |
309 // | 316 // |
310 AnalysisOptionsErrorCode.PARSE_ERROR, | 317 AnalysisOptionsErrorCode.PARSE_ERROR, |
311 AnalysisOptionsWarningCode.UNRECOGNIZED_ERROR_CODE, | 318 AnalysisOptionsWarningCode.UNRECOGNIZED_ERROR_CODE, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, | 350 CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, |
344 CompileTimeErrorCode.CONST_DEFERRED_CLASS, | 351 CompileTimeErrorCode.CONST_DEFERRED_CLASS, |
345 CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, | 352 CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, |
346 CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE, | 353 CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE, |
347 CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, | 354 CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, |
348 CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING, | 355 CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING, |
349 CompileTimeErrorCode.CONST_EVAL_TYPE_INT, | 356 CompileTimeErrorCode.CONST_EVAL_TYPE_INT, |
350 CompileTimeErrorCode.CONST_EVAL_TYPE_NUM, | 357 CompileTimeErrorCode.CONST_EVAL_TYPE_NUM, |
351 CompileTimeErrorCode.CONST_FORMAL_PARAMETER, | 358 CompileTimeErrorCode.CONST_FORMAL_PARAMETER, |
352 CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, | 359 CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, |
353 CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED
_LIBRARY, | 360 CompileTimeErrorCode |
| 361 .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY, |
354 CompileTimeErrorCode.CONST_INSTANCE_FIELD, | 362 CompileTimeErrorCode.CONST_INSTANCE_FIELD, |
355 CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, | 363 CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, |
356 CompileTimeErrorCode.CONST_NOT_INITIALIZED, | 364 CompileTimeErrorCode.CONST_NOT_INITIALIZED, |
357 CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS, | 365 CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS, |
358 CompileTimeErrorCode.CONST_WITH_NON_CONST, | 366 CompileTimeErrorCode.CONST_WITH_NON_CONST, |
359 CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, | 367 CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, |
360 CompileTimeErrorCode.CONST_WITH_NON_TYPE, | 368 CompileTimeErrorCode.CONST_WITH_NON_TYPE, |
361 CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, | 369 CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, |
362 CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, | 370 CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, |
363 CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, | 371 CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY, | 445 CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY, |
438 CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, | 446 CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, |
439 CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY, | 447 CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY, |
440 CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, | 448 CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, |
441 CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY, | 449 CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY, |
442 CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, | 450 CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, |
443 CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY, | 451 CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY, |
444 CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, | 452 CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, |
445 CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY, | 453 CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY, |
446 CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER, | 454 CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER, |
447 CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY
, | 455 CompileTimeErrorCode |
| 456 .NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY, |
448 CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT, | 457 CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT, |
449 CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, | 458 CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, |
450 CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS, | 459 CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS, |
451 CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS, | 460 CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS, |
452 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT, | 461 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT, |
453 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT, | 462 CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT, |
454 CompileTimeErrorCode.OBJECT_CANNOT_EXTEND_ANOTHER_CLASS, | 463 CompileTimeErrorCode.OBJECT_CANNOT_EXTEND_ANOTHER_CLASS, |
455 CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR, | 464 CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR, |
456 CompileTimeErrorCode.PART_OF_NON_PART, | 465 CompileTimeErrorCode.PART_OF_NON_PART, |
457 CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, | 466 CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 | 1170 |
1162 @override | 1171 @override |
1163 int get hashCode => ordinal; | 1172 int get hashCode => ordinal; |
1164 | 1173 |
1165 @override | 1174 @override |
1166 int compareTo(ErrorType other) => ordinal - other.ordinal; | 1175 int compareTo(ErrorType other) => ordinal - other.ordinal; |
1167 | 1176 |
1168 @override | 1177 @override |
1169 String toString() => name; | 1178 String toString() => name; |
1170 } | 1179 } |
OLD | NEW |