[−][src]Enum lrpar::parser::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: 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]
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 description(&self) -> &str
1.0.0[src]
This method is soft-deprecated. Read more
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
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<StorageT> Send for LexParseError<StorageT> where
StorageT: Send,
StorageT: Send,
impl<StorageT> Sync for LexParseError<StorageT> where
StorageT: Sync,
StorageT: Sync,
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
U: TryFrom<T>,