[][src]Enum lalrpop_util::ParseError

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

Generated by the parser when it encounters a token (or EOF) it did not expect.

Fields of InvalidToken

location: L
UnrecognizedEOF

Generated by the parser when it encounters an EOF it did not expect.

Fields of UnrecognizedEOF

location: L

The end of the final token

expected: Vec<String>

The set of expected tokens: these names are taken from the grammar and hence may not necessarily be suitable for presenting to the user.

UnrecognizedToken

Generated by the parser when it encounters a token it did not expect.

Fields of UnrecognizedToken

token: (L, T, L)

The unexpected token of type T with a span given by the two L values.

expected: Vec<String>

The set of expected tokens: these names are taken from the grammar and hence may not necessarily be suitable for presenting to the user.

ExtraToken

Generated by the parser when it encounters additional, unexpected tokens.

Fields of ExtraToken

token: (L, T, L)
User

Custom error type.

Fields of User

error: E

Methods

impl<L, T, E> ParseError<L, T, E>[src]

pub fn map_location<F, LL>(self, op: F) -> ParseError<LL, T, E> where
    F: Fn(L) -> LL, 
[src]

pub fn map_token<F, TT>(self, op: F) -> ParseError<L, TT, E> where
    F: Fn(T) -> TT, 
[src]

pub fn map_error<F, EE>(self, op: F) -> ParseError<L, T, EE> where
    F: Fn(E) -> EE, 
[src]

Trait Implementations

impl<L: Ord, T: Ord, E: Ord> Ord for ParseError<L, T, E>[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl<L: PartialOrd, T: PartialOrd, E: PartialOrd> PartialOrd<ParseError<L, T, E>> for ParseError<L, T, E>[src]

impl<L: PartialEq, T: PartialEq, E: PartialEq> PartialEq<ParseError<L, T, E>> for ParseError<L, T, E>[src]

impl<L: Clone, T: Clone, E: Clone> Clone for ParseError<L, T, E>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<L: Eq, T: Eq, E: Eq> Eq for ParseError<L, T, E>[src]

impl<L, T, E> Display for ParseError<L, T, E> where
    L: Display,
    T: Display,
    E: Display
[src]

impl<L: Debug, T: Debug, E: Debug> Debug for ParseError<L, T, E>[src]

impl<L, T, E> Error for ParseError<L, T, E> where
    L: Debug + Display,
    T: Debug + Display,
    E: Debug + Display
[src]

fn cause(&self) -> Option<&dyn Error>1.0.0[src]

Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

The lower-level cause of this error, if any. Read more

fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]

The lower-level source of this error, if any. Read more

Auto Trait Implementations

impl<L, T, E> Unpin for ParseError<L, T, E> where
    E: Unpin,
    L: Unpin,
    T: Unpin

impl<L, T, E> Send for ParseError<L, T, E> where
    E: Send,
    L: Send,
    T: Send

impl<L, T, E> Sync for ParseError<L, T, E> where
    E: Sync,
    L: Sync,
    T: Sync

impl<L, T, E> UnwindSafe for ParseError<L, T, E> where
    E: UnwindSafe,
    L: UnwindSafe,
    T: UnwindSafe

impl<L, T, E> RefUnwindSafe for ParseError<L, T, E> where
    E: RefUnwindSafe,
    L: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]