2019-04-19 02:40:25 -07:00
|
|
|
use crate::common::*;
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq)]
|
2021-07-26 01:26:06 -07:00
|
|
|
pub(crate) enum CompileErrorKind<'src> {
|
2019-04-19 02:40:25 -07:00
|
|
|
AliasShadowsRecipe {
|
2020-02-10 20:07:06 -08: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,
|
2020-02-10 20:07:06 -08: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,
|
2020-02-10 20:07:06 -08:00
|
|
|
found: usize,
|
|
|
|
min: usize,
|
|
|
|
max: usize,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
2021-03-28 23:39:23 -07:00
|
|
|
DeprecatedEquals,
|
2019-04-19 02:40:25 -07:00
|
|
|
DuplicateAlias {
|
2019-12-07 03:09:21 -08:00
|
|
|
alias: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
first: usize,
|
|
|
|
},
|
|
|
|
DuplicateParameter {
|
2020-02-10 20:07:06 -08:00
|
|
|
recipe: &'src str,
|
2019-12-07 03:09:21 -08:00
|
|
|
parameter: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
|
|
|
DuplicateRecipe {
|
2019-12-07 03:09:21 -08:00
|
|
|
recipe: &'src str,
|
2020-02-10 20:07:06 -08:00
|
|
|
first: usize,
|
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,
|
2020-02-10 20:07:06 -08: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>,
|
2020-10-26 18:16:42 -07:00
|
|
|
found: &'src str,
|
|
|
|
},
|
2019-04-19 02:40:25 -07:00
|
|
|
ExtraLeadingWhitespace,
|
|
|
|
FunctionArgumentCountMismatch {
|
2019-12-07 03:09:21 -08:00
|
|
|
function: &'src str,
|
2020-02-10 20:07:06 -08:00
|
|
|
found: usize,
|
2019-04-19 02:40:25 -07:00
|
|
|
expected: usize,
|
|
|
|
},
|
|
|
|
InconsistentLeadingWhitespace {
|
2019-12-07 03:09:21 -08:00
|
|
|
expected: &'src str,
|
2020-02-10 20:07:06 -08: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 {
|
|
|
|
close: Delimiter,
|
|
|
|
open: Delimiter,
|
|
|
|
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
|
|
|
},
|
|
|
|
ParameterShadowsVariable {
|
2019-12-07 03:09:21 -08:00
|
|
|
parameter: &'src str,
|
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
|
|
|
},
|
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>,
|
2020-02-10 20:07:06 -08:00
|
|
|
found: TokenKind,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
|
|
|
UnknownAliasTarget {
|
2020-02-10 20:07:06 -08:00
|
|
|
alias: &'src str,
|
2019-12-07 03:09:21 -08:00
|
|
|
target: &'src str,
|
2019-04-19 02:40:25 -07:00
|
|
|
},
|
|
|
|
UnknownDependency {
|
2020-02-10 20:07:06 -08: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
|
|
|
}
|