OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library analyzer.src.html.error.lint_codes; |
| 6 |
| 7 import 'package:analyzer/error/error.dart'; |
| 8 |
| 9 /** |
| 10 * The error codes used for errors in HTML files. The convention for this |
| 11 * class is for the name of the error code to indicate the problem that caused |
| 12 * the error to be generated and for the error message to explain what is wrong |
| 13 * and, when appropriate, how the problem can be corrected. |
| 14 */ |
| 15 class HtmlErrorCode extends ErrorCode { |
| 16 /** |
| 17 * An error code indicating that there is a syntactic error in the file. |
| 18 * |
| 19 * Parameters: |
| 20 * 0: the error message from the parse error |
| 21 */ |
| 22 static const HtmlErrorCode PARSE_ERROR = |
| 23 const HtmlErrorCode('PARSE_ERROR', '{0}'); |
| 24 |
| 25 /** |
| 26 * Initialize a newly created error code to have the given [name]. The message |
| 27 * associated with the error will be created from the given [message] |
| 28 * template. The correction associated with the error will be created from the |
| 29 * given [correction] template. |
| 30 */ |
| 31 const HtmlErrorCode(String name, String message, [String correction]) |
| 32 : super(name, message, correction); |
| 33 |
| 34 @override |
| 35 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; |
| 36 |
| 37 @override |
| 38 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; |
| 39 } |
| 40 |
| 41 /** |
| 42 * The error codes used for warnings in HTML files. The convention for this |
| 43 * class is for the name of the error code to indicate the problem that caused |
| 44 * the error to be generated and for the error message to explain what is wrong |
| 45 * and, when appropriate, how the problem can be corrected. |
| 46 */ |
| 47 class HtmlWarningCode extends ErrorCode { |
| 48 /** |
| 49 * An error code indicating that the value of the 'src' attribute of a Dart |
| 50 * script tag is not a valid URI. |
| 51 * |
| 52 * Parameters: |
| 53 * 0: the URI that is invalid |
| 54 */ |
| 55 static const HtmlWarningCode INVALID_URI = |
| 56 const HtmlWarningCode('INVALID_URI', "Invalid URI syntax: '{0}'."); |
| 57 |
| 58 /** |
| 59 * An error code indicating that the value of the 'src' attribute of a Dart |
| 60 * script tag references a file that does not exist. |
| 61 * |
| 62 * Parameters: |
| 63 * 0: the URI pointing to a non-existent file |
| 64 */ |
| 65 static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode( |
| 66 'URI_DOES_NOT_EXIST', "Target of URI doesn't exist: '{0}'."); |
| 67 |
| 68 /** |
| 69 * Initialize a newly created error code to have the given [name]. The message |
| 70 * associated with the error will be created from the given [message] |
| 71 * template. The correction associated with the error will be created from the |
| 72 * given [correction] template. |
| 73 */ |
| 74 const HtmlWarningCode(String name, String message, [String correction]) |
| 75 : super(name, message, correction); |
| 76 |
| 77 @override |
| 78 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING; |
| 79 |
| 80 @override |
| 81 ErrorType get type => ErrorType.STATIC_WARNING; |
| 82 } |
OLD | NEW |