Enum lalrpop_util::ParseError
source · pub enum ParseError<L, T, E> {
InvalidToken {
location: L,
},
UnrecognizedEOF {
location: L,
expected: Vec<String>,
},
UnrecognizedToken {
token: (L, T, L),
expected: Vec<String>,
},
ExtraToken {
token: (L, T, L),
},
User {
error: E,
},
}
Variants§
InvalidToken
Fields
§
location: L
Generated by the parser when it encounters a token (or EOF) it did not expect.
UnrecognizedEOF
Fields
§
location: L
The end of the final token
Generated by the parser when it encounters an EOF it did not expect.
UnrecognizedToken
Fields
Generated by the parser when it encounters a token it did not expect.
ExtraToken
Generated by the parser when it encounters additional, unexpected tokens.
User
Fields
§
error: E
Custom error type.
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: Clone, T: Clone, E: Clone> Clone for ParseError<L, T, E>
impl<L: Clone, T: Clone, E: Clone> 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> Error for ParseError<L, T, E>where
L: Debug + Display,
T: Debug + Display,
E: Debug + Display,
impl<L, T, E> Error for ParseError<L, T, E>where
L: Debug + Display,
T: Debug + Display,
E: Debug + Display,
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§impl<L: Ord, T: Ord, E: Ord> Ord for ParseError<L, T, E>
impl<L: Ord, T: Ord, E: Ord> 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: PartialEq, T: PartialEq, E: PartialEq> PartialEq<ParseError<L, T, E>> for ParseError<L, T, E>
impl<L: PartialEq, T: PartialEq, E: PartialEq> PartialEq<ParseError<L, T, E>> 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: PartialOrd, T: PartialOrd, E: PartialOrd> PartialOrd<ParseError<L, T, E>> for ParseError<L, T, E>
impl<L: PartialOrd, T: PartialOrd, E: PartialOrd> PartialOrd<ParseError<L, T, E>> 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