Enum hemtt_preprocessor::Error
source · pub enum Error {
Show 14 variants
UnexpectedToken {
token: Box<Token>,
expected: Vec<Symbol>,
trace: Vec<Token>,
},
UnexpectedEOF {
token: Box<Token>,
},
ExpectedIdent {
token: Box<Token>,
trace: Vec<Token>,
},
UnknownDirective {
directive: Box<Token>,
trace: Vec<Token>,
},
DefineMultiTokenArgument {
token: Box<Token>,
trace: Vec<Token>,
},
ChangeBuiltin {
token: Box<Token>,
trace: Vec<Token>,
},
IfUnitOrFunction {
token: Box<Token>,
trace: Vec<Token>,
},
IfUndefined {
token: Box<Token>,
trace: Vec<Token>,
},
FunctionCallArgumentCount {
token: Box<Token>,
expected: usize,
got: usize,
trace: Vec<Token>,
defines: Defines,
},
ExpectedFunctionOrValue {
token: Box<Token>,
trace: Vec<Token>,
skipped: Vec<Token>,
},
ResolveWithNoResolver {
token: Box<Token>,
trace: Vec<Token>,
},
IncludeNotFound {
target: Vec<Token>,
trace: Vec<Token>,
},
Io(Box<Error>),
Pest(Box<Error<Rule>>),
}
Expand description
Errors that can occur during preprocessing
Variants§
UnexpectedToken
Fields
Expected a token, found something else
UnexpectedEOF
Unexpected end of file
ExpectedIdent
Expected an identifier, found something else
UnknownDirective
Unknown directive
DefineMultiTokenArgument
Tried to create a FunctionDefinition
that has multi-token arguments
#define FUNC(my arg) ...
ChangeBuiltin
Tried to change a built-in macro
IfUnitOrFunction
Tried to use #if
on a Unit
or FunctionDefinition
IfUndefined
Tried to use #if
on an undefined macro
FunctionCallArgumentCount
Fields
Tried to call a FunctionDefinition
with the wrong number of arguments
ExpectedFunctionOrValue
Fields
Tried to use a Unit
as a function or value
ResolveWithNoResolver
Tried to use #include
with NoResolver
IncludeNotFound
The Resolver
could not find the target
Io(Box<Error>)
Pest(Box<Error<Rule>>)
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()