2022-06-18 21:56:31 -07:00
|
|
|
use super::*;
|
2019-04-19 02:40:25 -07:00
|
|
|
|
|
|
|
#[derive(Debug, PartialEq)]
|
2021-07-26 01:26:06 -07:00
|
|
|
pub(crate) enum CompileErrorKind<'src> {
|
2022-12-20 00:44:19 -08:00
|
|
|
AliasInvalidAttribute {
|
|
|
|
alias: &'src str,
|
2024-01-12 18:44:13 -08:00
|
|
|
attribute: Attribute<'src>,
|
2022-12-20 00:44:19 -08:00
|
|
|
},
|
2019-04-19 02:40:25 -07:00
|
|
|
AliasShadowsRecipe {
|
2021-09-16 06:44:40 -07:00
|
|
|
alias: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
recipe_line: usize,
|
|
|
|
},
|
2021-04-05 21:28:37 -07:00
|
|
|
BacktickShebang,
|
2019-04-19 02:40:25 -07:00
|
|
|
CircularRecipeDependency {
|
2019-12-07 03:09:21 -08:00
|
|
|
recipe: &'src str,
|
|
|
|
circle: Vec<&'src str>,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
|
|
|
CircularVariableDependency {
|
2019-12-07 03:09:21 -08:00
|
|
|
variable: &'src str,
|
2021-09-16 06:44:40 -07:00
|
|
|
circle: Vec<&'src str>,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
2019-12-07 04:03:03 -08:00
|
|
|
DependencyArgumentCountMismatch {
|
2019-12-07 03:09:21 -08:00
|
|
|
dependency: &'src str,
|
2021-09-16 06:44:40 -07:00
|
|
|
found: usize,
|
|
|
|
min: usize,
|
|
|
|
max: usize,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
2023-12-27 20:27:15 -08:00
|
|
|
Redefinition {
|
2019-04-19 02:40:25 -07:00
|
|
|
first: usize,
|
2023-12-27 20:27:15 -08:00
|
|
|
first_type: &'static str,
|
|
|
|
name: &'src str,
|
|
|
|
second_type: &'static str,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
2022-10-31 00:52:03 -07:00
|
|
|
DuplicateAttribute {
|
|
|
|
attribute: &'src str,
|
|
|
|
first: usize,
|
|
|
|
},
|
2019-04-19 02:40:25 -07:00
|
|
|
DuplicateParameter {
|
2021-09-16 06:44:40 -07:00
|
|
|
recipe: &'src str,
|
2019-12-07 03:09:21 -08:00
|
|
|
parameter: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
2019-11-10 23:17:47 -08:00
|
|
|
DuplicateSet {
|
2019-12-07 03:09:21 -08:00
|
|
|
setting: &'src str,
|
2021-09-16 06:44:40 -07:00
|
|
|
first: usize,
|
2019-11-10 23:17:47 -08:00
|
|
|
},
|
2021-07-26 01:26:06 -07:00
|
|
|
DuplicateVariable {
|
|
|
|
variable: &'src str,
|
|
|
|
},
|
2020-10-26 18:16:42 -07:00
|
|
|
ExpectedKeyword {
|
2021-03-28 22:38:07 -07:00
|
|
|
expected: Vec<Keyword>,
|
2022-06-30 03:34:11 -07:00
|
|
|
found: Token<'src>,
|
2020-10-26 18:16:42 -07:00
|
|
|
},
|
2019-04-19 02:40:25 -07:00
|
|
|
ExtraLeadingWhitespace,
|
|
|
|
FunctionArgumentCountMismatch {
|
2019-12-07 03:09:21 -08:00
|
|
|
function: &'src str,
|
2021-09-16 06:44:40 -07:00
|
|
|
found: usize,
|
2021-10-14 17:00:58 -07:00
|
|
|
expected: Range<usize>,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
2023-12-24 09:14:17 -08:00
|
|
|
Include,
|
2019-04-19 02:40:25 -07:00
|
|
|
InconsistentLeadingWhitespace {
|
2019-12-07 03:09:21 -08:00
|
|
|
expected: &'src str,
|
2021-09-16 06:44:40 -07:00
|
|
|
found: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
|
|
|
Internal {
|
|
|
|
message: String,
|
|
|
|
},
|
|
|
|
InvalidEscapeSequence {
|
|
|
|
character: char,
|
|
|
|
},
|
2021-07-26 01:26:06 -07:00
|
|
|
MismatchedClosingDelimiter {
|
2021-09-16 06:44:40 -07:00
|
|
|
close: Delimiter,
|
|
|
|
open: Delimiter,
|
2021-07-26 01:26:06 -07:00
|
|
|
open_line: usize,
|
|
|
|
},
|
2019-04-19 02:40:25 -07:00
|
|
|
MixedLeadingWhitespace {
|
2019-12-07 03:09:21 -08:00
|
|
|
whitespace: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
|
|
|
ParameterFollowsVariadicParameter {
|
2019-12-07 03:09:21 -08:00
|
|
|
parameter: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
2022-06-22 15:00:13 -07:00
|
|
|
ParsingRecursionDepthExceeded,
|
2019-04-19 02:40:25 -07:00
|
|
|
RequiredParameterFollowsDefaultParameter {
|
2019-12-07 03:09:21 -08:00
|
|
|
parameter: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
|
|
|
UndefinedVariable {
|
2019-12-07 03:09:21 -08:00
|
|
|
variable: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
2024-01-12 18:44:13 -08:00
|
|
|
UnexpectedAttributeArgument {
|
|
|
|
attribute: Attribute<'src>,
|
|
|
|
},
|
2021-07-26 01:26:06 -07:00
|
|
|
UnexpectedCharacter {
|
|
|
|
expected: char,
|
|
|
|
},
|
|
|
|
UnexpectedClosingDelimiter {
|
|
|
|
close: Delimiter,
|
|
|
|
},
|
|
|
|
UnexpectedEndOfToken {
|
|
|
|
expected: char,
|
|
|
|
},
|
2019-04-19 02:40:25 -07:00
|
|
|
UnexpectedToken {
|
|
|
|
expected: Vec<TokenKind>,
|
2021-09-16 06:44:40 -07:00
|
|
|
found: TokenKind,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
|
|
|
UnknownAliasTarget {
|
2021-09-16 06:44:40 -07:00
|
|
|
alias: &'src str,
|
2019-12-07 03:09:21 -08:00
|
|
|
target: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
2022-10-25 16:32:36 -07:00
|
|
|
UnknownAttribute {
|
|
|
|
attribute: &'src str,
|
|
|
|
},
|
2019-04-19 02:40:25 -07:00
|
|
|
UnknownDependency {
|
2021-09-16 06:44:40 -07:00
|
|
|
recipe: &'src str,
|
2019-12-07 03:09:21 -08:00
|
|
|
unknown: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
|
|
|
UnknownFunction {
|
2019-12-07 03:09:21 -08:00
|
|
|
function: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
2019-11-10 23:17:47 -08:00
|
|
|
UnknownSetting {
|
2019-12-07 03:09:21 -08:00
|
|
|
setting: &'src str,
|
2019-11-10 23:17:47 -08:00
|
|
|
},
|
2021-07-26 01:26:06 -07:00
|
|
|
UnknownStartOfToken,
|
2019-04-19 02:40:25 -07:00
|
|
|
UnpairedCarriageReturn,
|
2021-07-26 01:26:06 -07:00
|
|
|
UnterminatedBacktick,
|
2019-04-19 02:40:25 -07:00
|
|
|
UnterminatedInterpolation,
|
2021-04-05 21:28:37 -07:00
|
|
|
UnterminatedString,
|
2019-04-19 02:40:25 -07:00
|
|
|
}
|