Enum lang_util::error::ParseErrorKind
source · pub enum ParseErrorKind<E: LexicalError> {
InvalidToken,
UnrecognizedEof {
expected: Vec<String>,
},
UnrecognizedToken {
token: TokenDescription,
expected: Vec<String>,
},
ExtraToken {
token: TokenDescription,
},
LexicalError {
error: E,
},
}
Expand description
Parsing error kind
Variants§
InvalidToken
An invalid token was encountered during lexical analysis
UnrecognizedEof
Unexpected end of file
UnrecognizedToken
Unexpected token
Fields
§
token: TokenDescription
The unexpected token
ExtraToken
Extra token after input
Fields
§
token: TokenDescription
The extra token
LexicalError
Lexical analysis error
Fields
§
error: E
Lexical error
Trait Implementations§
source§impl<E: Clone + LexicalError> Clone for ParseErrorKind<E>
impl<E: Clone + LexicalError> Clone for ParseErrorKind<E>
source§fn clone(&self) -> ParseErrorKind<E>
fn clone(&self) -> ParseErrorKind<E>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<E: Debug + LexicalError> Debug for ParseErrorKind<E>
impl<E: Debug + LexicalError> Debug for ParseErrorKind<E>
source§impl<E: LexicalError> Display for ParseErrorKind<E>
impl<E: LexicalError> Display for ParseErrorKind<E>
source§impl<E: Error + LexicalError + 'static> Error for ParseErrorKind<E>
impl<E: Error + LexicalError + 'static> Error for ParseErrorKind<E>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<T: Token, E: LexicalError> From<ParseError<LexerPosition, T, E>> for ParseErrorKind<E>
impl<T: Token, E: LexicalError> From<ParseError<LexerPosition, T, E>> for ParseErrorKind<E>
source§fn from(error: ParseError<LexerPosition, T, E>) -> Self
fn from(error: ParseError<LexerPosition, T, E>) -> Self
Converts to this type from the input type.
source§impl<E: PartialEq + LexicalError> PartialEq for ParseErrorKind<E>
impl<E: PartialEq + LexicalError> PartialEq for ParseErrorKind<E>
impl<E: Eq + LexicalError> Eq for ParseErrorKind<E>
impl<E: LexicalError> StructuralPartialEq for ParseErrorKind<E>
Auto Trait Implementations§
impl<E> Freeze for ParseErrorKind<E>where
E: Freeze,
impl<E> RefUnwindSafe for ParseErrorKind<E>where
E: RefUnwindSafe,
impl<E> Send for ParseErrorKind<E>where
E: Send,
impl<E> Sync for ParseErrorKind<E>where
E: Sync,
impl<E> Unpin for ParseErrorKind<E>where
E: Unpin,
impl<E> UnwindSafe for ParseErrorKind<E>where
E: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)