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
Expected a token, found something else
Fields
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
Tried to call a FunctionDefinition with the wrong number of arguments
Fields
ExpectedFunctionOrValue
Tried to use a Unit as a function or value
Fields
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)>
Returns 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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more