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/scanner/scanner.dart' show ScannerErrorCode; | 14 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; |
| 15 import 'package:analyzer/src/generated/generated/shared_messages.dart' |
| 16 as shared_messages; |
15 import 'package:analyzer/src/generated/java_core.dart'; | 17 import 'package:analyzer/src/generated/java_core.dart'; |
16 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; | 18 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; |
17 import 'package:analyzer/src/generated/source.dart'; | 19 import 'package:analyzer/src/generated/source.dart'; |
18 import 'package:analyzer/src/task/model.dart'; | 20 import 'package:analyzer/src/task/model.dart'; |
19 import 'package:analyzer/task/model.dart'; | 21 import 'package:analyzer/task/model.dart'; |
20 import 'package:source_span/source_span.dart'; | 22 import 'package:source_span/source_span.dart'; |
21 | 23 |
22 /** | 24 /** |
23 * The descriptor used to associate error processors with analysis contexts in | 25 * The descriptor used to associate error processors with analysis contexts in |
24 * configuration data. | 26 * configuration data. |
(...skipping 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2221 */ | 2223 */ |
2222 static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = | 2224 static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = |
2223 const CompileTimeErrorCode( | 2225 const CompileTimeErrorCode( |
2224 'RETHROW_OUTSIDE_CATCH', "rethrow must be inside of a catch clause"); | 2226 'RETHROW_OUTSIDE_CATCH', "rethrow must be inside of a catch clause"); |
2225 | 2227 |
2226 /** | 2228 /** |
2227 * 13.12 Return: It is a compile-time error if a return statement of the form | 2229 * 13.12 Return: It is a compile-time error if a return statement of the form |
2228 * <i>return e;</i> appears in a generative constructor. | 2230 * <i>return e;</i> appears in a generative constructor. |
2229 */ | 2231 */ |
2230 static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = | 2232 static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = |
2231 const CompileTimeErrorCode('RETURN_IN_GENERATIVE_CONSTRUCTOR', | 2233 shared_messages.RETURN_IN_GENERATIVE_CONSTRUCTOR; |
2232 "Constructors cannot return a value"); | |
2233 | 2234 |
2234 /** | 2235 /** |
2235 * 13.12 Return: It is a compile-time error if a return statement of the form | 2236 * 13.12 Return: It is a compile-time error if a return statement of the form |
2236 * <i>return e;</i> appears in a generator function. | 2237 * <i>return e;</i> appears in a generator function. |
2237 */ | 2238 */ |
2238 static const CompileTimeErrorCode RETURN_IN_GENERATOR = | 2239 static const CompileTimeErrorCode RETURN_IN_GENERATOR = |
2239 const CompileTimeErrorCode('RETURN_IN_GENERATOR', | 2240 shared_messages.RETURN_IN_GENERATOR; |
2240 "Cannot return a value from a generator function (one marked with eith
er 'async*' or 'sync*')"); | |
2241 | 2241 |
2242 /** | 2242 /** |
2243 * 14.1 Imports: It is a compile-time error if a prefix used in a deferred | 2243 * 14.1 Imports: It is a compile-time error if a prefix used in a deferred |
2244 * import is used in another import clause. | 2244 * import is used in another import clause. |
2245 */ | 2245 */ |
2246 static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX = | 2246 static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX = |
2247 const CompileTimeErrorCode('SHARED_DEFERRED_PREFIX', | 2247 const CompileTimeErrorCode('SHARED_DEFERRED_PREFIX', |
2248 "The prefix of a deferred import cannot be used in other import direct
ives"); | 2248 "The prefix of a deferred import cannot be used in other import direct
ives"); |
2249 | 2249 |
2250 /** | 2250 /** |
(...skipping 3440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5691 * Initialize a newly created error code to have the given [name]. | 5691 * Initialize a newly created error code to have the given [name]. |
5692 */ | 5692 */ |
5693 const TodoCode(String name) : super(name, "{0}"); | 5693 const TodoCode(String name) : super(name, "{0}"); |
5694 | 5694 |
5695 @override | 5695 @override |
5696 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; | 5696 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; |
5697 | 5697 |
5698 @override | 5698 @override |
5699 ErrorType get type => ErrorType.TODO; | 5699 ErrorType get type => ErrorType.TODO; |
5700 } | 5700 } |
OLD | NEW |