[][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>)

Methods

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

pub fn pp<'a>(
    &self,
    lexer: &dyn Lexer<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: Hash> From<LexError> for LexParseError<StorageT>[src]

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

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

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

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

fn description(&self) -> &str
1.0.0
[src]

This method is soft-deprecated. Read more

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

fn type_id(&self) -> TypeId where
    Self: 'static, 
1.34.0
[src]

Gets the TypeId of self

Auto Trait Implementations

impl<StorageT> Send for LexParseError<StorageT> where
    StorageT: Send

impl<StorageT> Sync for LexParseError<StorageT> where
    StorageT: Sync

Blanket Implementations

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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> 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]

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

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