[][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: Clone, T: Clone, E: Clone> Clone for ParseError<L, T, E>[src]

impl<L: Debug, T: Debug, E: Debug> Debug 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: Eq, T: Eq, E: Eq> Eq 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]

impl<L: Ord, T: Ord, E: Ord> Ord 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: PartialOrd, T: PartialOrd, E: PartialOrd> PartialOrd<ParseError<L, T, E>> for ParseError<L, T, E>[src]

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

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

Auto Trait Implementations

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

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> Unpin for ParseError<L, T, E> where
    E: Unpin,
    L: Unpin,
    T: Unpin

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

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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.