Enum arithmetic_parser::ErrorKind
source · #[non_exhaustive]pub enum ErrorKind {
NonAsciiInput,
Literal(Error),
LiteralName,
Type(Error),
UnsupportedOp(Op),
UnexpectedChar {
context: Option<Context>,
},
UnexpectedTerm {
context: Option<Context>,
},
Leftovers,
Incomplete,
UnfinishedComment,
ChainedComparison,
Other {
kind: ErrorKind,
context: Option<Context>,
},
}
Expand description
Parsing error kind.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NonAsciiInput
Input is not in ASCII.
Literal(Error)
Error parsing literal.
LiteralName
Literal is used where a name is expected, e.g., as a function identifier.
An example of input triggering this error is 1(2, x)
; 1
is used as the function
identifier.
Type(Error)
Error parsing type annotation.
UnsupportedOp(Op)
Unary or binary operation switched off in the parser features.
UnexpectedChar
No rules where expecting this character.
UnexpectedTerm
Unexpected expression end.
Leftovers
Leftover symbols after parsing.
Incomplete
Input is incomplete.
UnfinishedComment
Unfinished comment.
ChainedComparison
Chained comparison, such as 1 < 2 < 3
.
Other
Other parsing error.
Implementations§
Trait Implementations§
source§impl Error for ErrorKind
impl Error for ErrorKind
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()
source§impl<'a> FromExternalError<LocatedSpan<&'a str>, ErrorKind> for Error
impl<'a> FromExternalError<LocatedSpan<&'a str>, ErrorKind> for Error
source§fn from_external_error(
input: InputSpan<'a>,
_: NomErrorKind,
err: ErrorKind,
) -> Self
fn from_external_error( input: InputSpan<'a>, _: NomErrorKind, err: ErrorKind, ) -> Self
Creates a new error from an input position, an ErrorKind indicating the
wrapping parser, and an external error
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
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