[][src]Enum lalrpop_util::ParseError

pub enum ParseError<L, T, E> {
    InvalidToken {
        location: L,
    },
    UnrecognizedToken {
        token: Option<(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
UnrecognizedToken

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

Fields of UnrecognizedToken

token: Option<(L, T, L)>

If this is Some, then an unexpected token of type T was observed, with a span given by the two L values. If this is None, then EOF was observed when it was not expected.

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

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

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, 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> 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

Blanket Implementations

impl<T> From for T
[src]

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

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

type Owned = T

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

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

type Error = !

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

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

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