pub enum ParseError {
UnexpectedToken {
found: TokenKind,
expected: Vec<TokenKind>,
span: Span,
},
UnexpectedEof {
expected: Vec<TokenKind>,
span: Span,
},
LexerError {
message: String,
span: Span,
},
}Expand description
Domaenenspezifische Parser-Fehler.
Wird vom Lexer (Woche 2), Recognizer (spaetere Anbindung), CST-Builder
und AST-Builder konsumiert. Jede Variante laesst sich via
ParseError::to_diagnostic in eine Diagnostic ueberfuehren.
Variants§
UnexpectedToken
Erwartet wurde eine bestimmte Token-Menge, gefunden wurde ein anderes Token.
Fields
UnexpectedEof
Eingabe endete vor Abschluss der Production. Erwartet wurde noch mindestens ein Token.
Fields
LexerError
Lexer-spezifischer Fehler (ungueltige Zeichen-Sequenz, unterminated String, etc.). Detail-Text ist lexer-spezifisch.
Implementations§
Source§impl ParseError
impl ParseError
Sourcepub fn to_diagnostic(&self) -> Diagnostic
pub fn to_diagnostic(&self) -> Diagnostic
Konvertiert einen Parser-Fehler in eine uniforme Diagnostic.
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParseError
impl Debug for ParseError
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ParseError
impl PartialEq for ParseError
Source§fn eq(&self, other: &ParseError) -> bool
fn eq(&self, other: &ParseError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ParseError
impl StructuralPartialEq for ParseError
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnsafeUnpin for ParseError
impl UnwindSafe for ParseError
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