| 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'; | |
| 10 import 'package:analyzer/error/listener.dart'; | 9 import 'package:analyzer/error/listener.dart'; |
| 11 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; | 10 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; |
| 12 import 'package:analyzer/src/error/codes.dart'; | 11 import 'package:analyzer/src/error/codes.dart'; |
| 13 import 'package:analyzer/src/generated/resolver.dart' show ResolverErrorCode; | |
| 14 import 'package:analyzer/src/generated/java_core.dart'; | 12 import 'package:analyzer/src/generated/java_core.dart'; |
| 15 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; | 13 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; |
| 14 import 'package:analyzer/src/generated/resolver.dart' show ResolverErrorCode; |
| 16 import 'package:analyzer/src/generated/source.dart'; | 15 import 'package:analyzer/src/generated/source.dart'; |
| 17 import 'package:front_end/src/base/errors.dart'; | 16 import 'package:front_end/src/base/errors.dart'; |
| 18 import 'package:front_end/src/scanner/errors.dart'; | 17 import 'package:front_end/src/scanner/errors.dart'; |
| 19 | 18 |
| 20 export 'package:front_end/src/base/errors.dart' | 19 export 'package:front_end/src/base/errors.dart' |
| 21 show ErrorCode, ErrorSeverity, ErrorType; | 20 show ErrorCode, ErrorSeverity, ErrorType; |
| 22 | 21 |
| 23 const List<ErrorCode> errorCodeValues = const [ | 22 const List<ErrorCode> errorCodeValues = const [ |
| 24 // | 23 // |
| 25 // Manually generated. You can mostly reproduce this list by running the | 24 // Manually generated. You can mostly reproduce this list by running the |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 void setProperty/*<V>*/(ErrorProperty/*<V>*/ property, Object/*=V*/ value) { | 854 void setProperty/*<V>*/(ErrorProperty/*<V>*/ property, Object/*=V*/ value) { |
| 856 _propertyMap[property] = value; | 855 _propertyMap[property] = value; |
| 857 } | 856 } |
| 858 } | 857 } |
| 859 | 858 |
| 860 /** | 859 /** |
| 861 * The properties that can be associated with an [AnalysisError]. | 860 * The properties that can be associated with an [AnalysisError]. |
| 862 */ | 861 */ |
| 863 class ErrorProperty<V> implements Comparable<ErrorProperty> { | 862 class ErrorProperty<V> implements Comparable<ErrorProperty> { |
| 864 /** | 863 /** |
| 865 * A property whose value is a list of [FieldElement]s that are final, but | |
| 866 * not initialized by a constructor. | |
| 867 */ | |
| 868 static const ErrorProperty<List<FieldElement>> NOT_INITIALIZED_FIELDS = | |
| 869 const ErrorProperty<List<FieldElement>>('NOT_INITIALIZED_FIELDS', 0); | |
| 870 | |
| 871 /** | |
| 872 * A property whose value is the name of the library that is used by all | 864 * A property whose value is the name of the library that is used by all |
| 873 * of the "part of" directives, so should be used in the "library" directive. | 865 * of the "part of" directives, so should be used in the "library" directive. |
| 874 * Is `null` if there is no a single name used by all of the parts. | 866 * Is `null` if there is no a single name used by all of the parts. |
| 875 */ | 867 */ |
| 876 static const ErrorProperty<String> PARTS_LIBRARY_NAME = | 868 static const ErrorProperty<String> PARTS_LIBRARY_NAME = |
| 877 const ErrorProperty<String>('PARTS_LIBRARY_NAME', 1); | 869 const ErrorProperty<String>('PARTS_LIBRARY_NAME', 1); |
| 878 | 870 |
| 879 static const List<ErrorProperty> values = const [ | 871 static const List<ErrorProperty> values = const [ |
| 880 NOT_INITIALIZED_FIELDS, | |
| 881 PARTS_LIBRARY_NAME, | 872 PARTS_LIBRARY_NAME, |
| 882 ]; | 873 ]; |
| 883 | 874 |
| 884 /** | 875 /** |
| 885 * The name of this property. | 876 * The name of this property. |
| 886 */ | 877 */ |
| 887 final String name; | 878 final String name; |
| 888 | 879 |
| 889 /** | 880 /** |
| 890 * The ordinal value of the property. | 881 * The ordinal value of the property. |
| 891 */ | 882 */ |
| 892 final int ordinal; | 883 final int ordinal; |
| 893 | 884 |
| 894 const ErrorProperty(this.name, this.ordinal); | 885 const ErrorProperty(this.name, this.ordinal); |
| 895 | 886 |
| 896 @override | 887 @override |
| 897 int get hashCode => ordinal; | 888 int get hashCode => ordinal; |
| 898 | 889 |
| 899 @override | 890 @override |
| 900 int compareTo(ErrorProperty other) => ordinal - other.ordinal; | 891 int compareTo(ErrorProperty other) => ordinal - other.ordinal; |
| 901 | 892 |
| 902 @override | 893 @override |
| 903 String toString() => name; | 894 String toString() => name; |
| 904 } | 895 } |
| OLD | NEW |