| 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.src.generated.error; | 5 library analyzer.src.generated.error; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart' show AstNode; | 9 import 'package:analyzer/dart/ast/ast.dart' show AstNode; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| 11 import 'package:analyzer/dart/element/element.dart'; | 11 import 'package:analyzer/dart/element/element.dart'; |
| 12 import 'package:analyzer/dart/element/type.dart'; | 12 import 'package:analyzer/dart/element/type.dart'; |
| 13 import 'package:analyzer/source/error_processor.dart'; | 13 import 'package:analyzer/source/error_processor.dart'; |
| 14 import 'package:analyzer/src/dart/element/type.dart'; | 14 import 'package:analyzer/src/dart/element/type.dart'; |
| 15 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; | 15 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; |
| 16 import 'package:analyzer/src/generated/engine.dart'; |
| 16 import 'package:analyzer/src/generated/generated/shared_messages.dart' | 17 import 'package:analyzer/src/generated/generated/shared_messages.dart' |
| 17 as shared_messages; | 18 as shared_messages; |
| 18 import 'package:analyzer/src/generated/java_core.dart'; | 19 import 'package:analyzer/src/generated/java_core.dart'; |
| 19 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; | 20 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; |
| 20 import 'package:analyzer/src/generated/source.dart'; | 21 import 'package:analyzer/src/generated/source.dart'; |
| 21 import 'package:analyzer/src/task/model.dart'; | 22 import 'package:analyzer/src/task/model.dart'; |
| 22 import 'package:analyzer/task/model.dart'; | 23 import 'package:analyzer/task/model.dart'; |
| 23 import 'package:source_span/source_span.dart'; | 24 import 'package:source_span/source_span.dart'; |
| 24 | 25 |
| 25 /** | 26 /** |
| (...skipping 5670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5696 * Parameters: | 5697 * Parameters: |
| 5697 * 0: the name of the constant that is missing | 5698 * 0: the name of the constant that is missing |
| 5698 */ | 5699 */ |
| 5699 static const StaticWarningCode MISSING_ENUM_CONSTANT_IN_SWITCH = | 5700 static const StaticWarningCode MISSING_ENUM_CONSTANT_IN_SWITCH = |
| 5700 const StaticWarningCode( | 5701 const StaticWarningCode( |
| 5701 'MISSING_ENUM_CONSTANT_IN_SWITCH', | 5702 'MISSING_ENUM_CONSTANT_IN_SWITCH', |
| 5702 "Missing case clause for '{0}'", | 5703 "Missing case clause for '{0}'", |
| 5703 "Add a case clause for the missing constant or add a default clause.")
; | 5704 "Add a case clause for the missing constant or add a default clause.")
; |
| 5704 | 5705 |
| 5705 /** | 5706 /** |
| 5707 * A flag indicating whether this warning is an error when running with strong |
| 5708 * mode enabled. |
| 5709 */ |
| 5710 final bool isStrongModeError; |
| 5711 |
| 5712 /** |
| 5706 * Initialize a newly created error code to have the given [name]. The message | 5713 * Initialize a newly created error code to have the given [name]. The message |
| 5707 * associated with the error will be created from the given [message] | 5714 * associated with the error will be created from the given [message] |
| 5708 * template. The correction associated with the error will be created from the | 5715 * template. The correction associated with the error will be created from the |
| 5709 * given [correction] template. | 5716 * given [correction] template. |
| 5710 */ | 5717 */ |
| 5711 const StaticWarningCode(String name, String message, [String correction]) | 5718 const StaticWarningCode(String name, String message, |
| 5719 [String correction, this.isStrongModeError = false]) |
| 5712 : super(name, message, correction); | 5720 : super(name, message, correction); |
| 5713 | 5721 |
| 5714 @override | 5722 @override |
| 5715 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity; | 5723 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity; |
| 5716 | 5724 |
| 5717 @override | 5725 @override |
| 5718 ErrorType get type => ErrorType.STATIC_WARNING; | 5726 ErrorType get type => ErrorType.STATIC_WARNING; |
| 5719 } | 5727 } |
| 5720 | 5728 |
| 5721 /** | 5729 /** |
| (...skipping 26 matching lines...) Expand all Loading... |
| 5748 * Initialize a newly created error code to have the given [name]. | 5756 * Initialize a newly created error code to have the given [name]. |
| 5749 */ | 5757 */ |
| 5750 const TodoCode(String name) : super(name, "{0}"); | 5758 const TodoCode(String name) : super(name, "{0}"); |
| 5751 | 5759 |
| 5752 @override | 5760 @override |
| 5753 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; | 5761 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; |
| 5754 | 5762 |
| 5755 @override | 5763 @override |
| 5756 ErrorType get type => ErrorType.TODO; | 5764 ErrorType get type => ErrorType.TODO; |
| 5757 } | 5765 } |
| OLD | NEW |