[][src]Enum lrpar::LexParseError

pub enum LexParseError<StorageT: Hash> {
    LexError(LexError),
    ParseError(ParseError<StorageT>),
}

A lexing or parsing error. Although the two are quite distinct in terms of what can be reported to users, both can (at least conceptually) occur at any point of the intertwined lexing/parsing process.

Variants

LexError(LexError)
ParseError(ParseError<StorageT>)

Implementations

impl<StorageT: Hash + PrimInt + Unsigned> LexParseError<StorageT>[src]

pub fn pp<'a>(
    &self,
    lexer: &dyn NonStreamingLexer<'_, StorageT>,
    epp: &dyn Fn(TIdx<StorageT>) -> Option<&'a str>
) -> String
[src]

A pretty-printer of a lexer/parser error. This isn't suitable for all purposes, but it's often good enough. The output format is not guaranteed to be stable but is likely to be of the form:

Parsing error at line 3 column 8. Repair sequences found:
  1: Insert ID
  2: Delete +, Shift 3

If you are using the compile-time parse system, your grm_y module exposes a suitable epp function; if you are using the run-time system, YaccGrammar exposes a suitable epp function, though you will have to wrap it in a closure e.g. &|t| grm.token_epp(t).

Trait Implementations

impl<StorageT: Debug + Hash> Debug for LexParseError<StorageT>[src]

impl<StorageT: Debug + Hash> Display for LexParseError<StorageT>[src]

impl<StorageT: Debug + Hash> Error for LexParseError<StorageT>[src]

impl<StorageT: Hash> From<LexError> for LexParseError<StorageT>[src]

impl<StorageT: Hash> From<ParseError<StorageT>> for LexParseError<StorageT>[src]

Auto Trait Implementations

impl<StorageT> RefUnwindSafe for LexParseError<StorageT> where
    StorageT: RefUnwindSafe
[src]

impl<StorageT> Send for LexParseError<StorageT> where
    StorageT: Send
[src]

impl<StorageT> Sync for LexParseError<StorageT> where
    StorageT: Sync
[src]

impl<StorageT> Unpin for LexParseError<StorageT> where
    StorageT: Unpin
[src]

impl<StorageT> UnwindSafe for LexParseError<StorageT> where
    StorageT: UnwindSafe
[src]

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

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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