[−][src]Enum lrpar::LexParseError
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]
&self,
lexer: &dyn Lexer<StorageT>,
epp: &dyn Fn(TIdx<StorageT>) -> Option<&'a str>
) -> String
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]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl<StorageT: Hash> From<LexError> for LexParseError<StorageT>
[src]
fn from(err: LexError) -> LexParseError<StorageT>
[src]
impl<StorageT: Hash> From<ParseError<StorageT>> for LexParseError<StorageT>
[src]
fn from(err: ParseError<StorageT>) -> LexParseError<StorageT>
[src]
Auto Trait Implementations
impl<StorageT> RefUnwindSafe for LexParseError<StorageT> where
StorageT: RefUnwindSafe,
StorageT: RefUnwindSafe,
impl<StorageT> Send for LexParseError<StorageT> where
StorageT: Send,
StorageT: Send,
impl<StorageT> Sync for LexParseError<StorageT> where
StorageT: Sync,
StorageT: Sync,
impl<StorageT> Unpin for LexParseError<StorageT> where
StorageT: Unpin,
StorageT: Unpin,
impl<StorageT> UnwindSafe for LexParseError<StorageT> where
StorageT: UnwindSafe,
StorageT: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,