Type Alias edlang_parser::error::Error
source · pub type Error = ParseError<usize, Token, LexicalError>;
Aliased Type§
enum Error {
InvalidToken {
location: usize,
},
UnrecognizedEof {
location: usize,
expected: Vec<String>,
},
UnrecognizedToken {
token: (usize, Token, usize),
expected: Vec<String>,
},
ExtraToken {
token: (usize, Token, usize),
},
User {
error: LexicalError,
},
}
Variants§
InvalidToken
Generated by the parser when it encounters a token (or EOF) it did not expect.
UnrecognizedEof
Generated by the parser when it encounters an EOF it did not expect.
Fields
UnrecognizedToken
Generated by the parser when it encounters a token it did not expect.
Fields
ExtraToken
Generated by the parser when it encounters additional, unexpected tokens.
User
Custom error type.
Fields
§
error: LexicalError
Implementations
source§impl<L, T, E> ParseError<L, T, E>
impl<L, T, E> ParseError<L, T, E>
pub fn map_location<LL>(self, op: impl FnMut(L) -> LL) -> ParseError<LL, T, E>
pub fn map_token<TT>(self, op: impl FnOnce(T) -> TT) -> ParseError<L, TT, E>
pub fn map_error<EE>(self, op: impl FnOnce(E) -> EE) -> ParseError<L, T, EE>
Trait Implementations
source§impl<L, T, E> Clone for ParseError<L, T, E>
impl<L, T, E> Clone for ParseError<L, T, E>
source§fn clone(&self) -> ParseError<L, T, E>
fn clone(&self) -> ParseError<L, T, E>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<L, T, E> Debug for ParseError<L, T, E>
impl<L, T, E> Debug for ParseError<L, T, E>
source§impl<L, T, E> Display for ParseError<L, T, E>
impl<L, T, E> Display for ParseError<L, T, E>
source§impl<L, T, E> Error for ParseError<L, T, E>
impl<L, T, E> Error for ParseError<L, T, E>
source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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
source§impl<L, T, E> From<E> for ParseError<L, T, E>
impl<L, T, E> From<E> for ParseError<L, T, E>
source§fn from(error: E) -> ParseError<L, T, E>
fn from(error: E) -> ParseError<L, T, E>
Converts to this type from the input type.
source§impl<L, T, E> Ord for ParseError<L, T, E>
impl<L, T, E> Ord for ParseError<L, T, E>
source§fn cmp(&self, other: &ParseError<L, T, E>) -> Ordering
fn cmp(&self, other: &ParseError<L, T, E>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<L, T, E> PartialEq for ParseError<L, T, E>
impl<L, T, E> PartialEq for ParseError<L, T, E>
source§fn eq(&self, other: &ParseError<L, T, E>) -> bool
fn eq(&self, other: &ParseError<L, T, E>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<L, T, E> PartialOrd for ParseError<L, T, E>
impl<L, T, E> PartialOrd for ParseError<L, T, E>
source§fn partial_cmp(&self, other: &ParseError<L, T, E>) -> Option<Ordering>
fn partial_cmp(&self, other: &ParseError<L, T, E>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more