|
| 1 | +// Copyright (c) 2021, 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 | +// THIS FILE IS GENERATED. DO NOT EDIT. |
| 6 | +// |
| 7 | +// Instead modify 'pkg/analyzer/messages.yaml' and run |
| 8 | +// 'dart run pkg/analyzer/tool/messages/generate.dart' to update. |
| 9 | + |
| 10 | +// While transitioning `HintCodes` to `WarningCodes`, we refer to deprecated |
| 11 | +// codes here. |
| 12 | +// ignore_for_file: deprecated_member_use_from_same_package |
| 13 | +// |
| 14 | +// Generated comments don't quite align with flutter style. |
| 15 | +// ignore_for_file: flutter_style_todos |
| 16 | + |
| 17 | +/// @docImport 'package:analyzer/src/dart/error/syntactic_errors.g.dart'; |
| 18 | +/// @docImport 'package:analyzer/src/error/inference_error.dart'; |
| 19 | +@Deprecated( |
| 20 | + // This library is deprecated to prevent it from being accidentally imported |
| 21 | + // It should only be imported by the corresponding non-code-generated library |
| 22 | + // (which suppresses the deprecation warning using an "ignore" comment). |
| 23 | + 'Use package:_fe_analyzer_shared/src/scanner/errors.dart instead', |
| 24 | +) |
| 25 | +library; |
| 26 | + |
| 27 | +import "package:_fe_analyzer_shared/src/base/errors.dart"; |
| 28 | + |
| 29 | +class ScannerErrorCode extends DiagnosticCode { |
| 30 | + /// Parameters: |
| 31 | + /// 0: the token that was expected but not found |
| 32 | + static const ScannerErrorCode EXPECTED_TOKEN = const ScannerErrorCode( |
| 33 | + 'EXPECTED_TOKEN', |
| 34 | + "Expected to find '{0}'.", |
| 35 | + ); |
| 36 | + |
| 37 | + /// Parameters: |
| 38 | + /// 0: the illegal character |
| 39 | + static const ScannerErrorCode ILLEGAL_CHARACTER = const ScannerErrorCode( |
| 40 | + 'ILLEGAL_CHARACTER', |
| 41 | + "Illegal character '{0}'.", |
| 42 | + ); |
| 43 | + |
| 44 | + static const ScannerErrorCode MISSING_DIGIT = const ScannerErrorCode( |
| 45 | + 'MISSING_DIGIT', |
| 46 | + "Decimal digit expected.", |
| 47 | + ); |
| 48 | + |
| 49 | + static const ScannerErrorCode MISSING_HEX_DIGIT = const ScannerErrorCode( |
| 50 | + 'MISSING_HEX_DIGIT', |
| 51 | + "Hexadecimal digit expected.", |
| 52 | + ); |
| 53 | + |
| 54 | + static const ScannerErrorCode MISSING_IDENTIFIER = const ScannerErrorCode( |
| 55 | + 'MISSING_IDENTIFIER', |
| 56 | + "Expected an identifier.", |
| 57 | + ); |
| 58 | + |
| 59 | + static const ScannerErrorCode MISSING_QUOTE = const ScannerErrorCode( |
| 60 | + 'MISSING_QUOTE', |
| 61 | + "Expected quote (' or \").", |
| 62 | + ); |
| 63 | + |
| 64 | + /// Parameters: |
| 65 | + /// 0: the path of the file that cannot be read |
| 66 | + static const ScannerErrorCode UNABLE_GET_CONTENT = const ScannerErrorCode( |
| 67 | + 'UNABLE_GET_CONTENT', |
| 68 | + "Unable to get content of '{0}'.", |
| 69 | + ); |
| 70 | + |
| 71 | + static const ScannerErrorCode |
| 72 | + UNEXPECTED_DOLLAR_IN_STRING = const ScannerErrorCode( |
| 73 | + 'UNEXPECTED_DOLLAR_IN_STRING', |
| 74 | + "A '\$' has special meaning inside a string, and must be followed by an " |
| 75 | + "identifier or an expression in curly braces ({}).", |
| 76 | + correctionMessage: "Try adding a backslash (\\) to escape the '\$'.", |
| 77 | + ); |
| 78 | + |
| 79 | + static const ScannerErrorCode |
| 80 | + UNEXPECTED_SEPARATOR_IN_NUMBER = const ScannerErrorCode( |
| 81 | + 'UNEXPECTED_SEPARATOR_IN_NUMBER', |
| 82 | + "Digit separators ('_') in a number literal can only be placed between two " |
| 83 | + "digits.", |
| 84 | + correctionMessage: "Try removing the '_'.", |
| 85 | + ); |
| 86 | + |
| 87 | + /// Parameters: |
| 88 | + /// 0: the unsupported operator |
| 89 | + static const ScannerErrorCode UNSUPPORTED_OPERATOR = const ScannerErrorCode( |
| 90 | + 'UNSUPPORTED_OPERATOR', |
| 91 | + "The '{0}' operator is not supported.", |
| 92 | + ); |
| 93 | + |
| 94 | + static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT = |
| 95 | + const ScannerErrorCode( |
| 96 | + 'UNTERMINATED_MULTI_LINE_COMMENT', |
| 97 | + "Unterminated multi-line comment.", |
| 98 | + correctionMessage: |
| 99 | + "Try terminating the comment with '*/', or removing any unbalanced " |
| 100 | + "occurrences of '/*' (because comments nest in Dart).", |
| 101 | + ); |
| 102 | + |
| 103 | + static const ScannerErrorCode UNTERMINATED_STRING_LITERAL = |
| 104 | + const ScannerErrorCode( |
| 105 | + 'UNTERMINATED_STRING_LITERAL', |
| 106 | + "Unterminated string literal.", |
| 107 | + ); |
| 108 | + |
| 109 | + /// Initialize a newly created error code to have the given [name]. |
| 110 | + const ScannerErrorCode( |
| 111 | + String name, |
| 112 | + String problemMessage, { |
| 113 | + super.correctionMessage, |
| 114 | + super.hasPublishedDocs = false, |
| 115 | + super.isUnresolvedIdentifier = false, |
| 116 | + String? uniqueName, |
| 117 | + }) : super( |
| 118 | + name: name, |
| 119 | + problemMessage: problemMessage, |
| 120 | + uniqueName: 'ScannerErrorCode.${uniqueName ?? name}', |
| 121 | + ); |
| 122 | + |
| 123 | + @override |
| 124 | + DiagnosticSeverity get severity => DiagnosticType.SYNTACTIC_ERROR.severity; |
| 125 | + |
| 126 | + @override |
| 127 | + DiagnosticType get type => DiagnosticType.SYNTACTIC_ERROR; |
| 128 | +} |
0 commit comments