pub struct LexError {
pub code: u16,
pub message: String,
pub range: TextRange,
}Expand description
A lexer-level diagnostic: a code (matching DiagCode discriminants in
cyrs-diag) plus a message and byte range. Emitted by
validate_tokens for errors that can only be detected after the DFA
run — unterminated literals, invalid escape sequences, etc.
cyrs-syntax does not depend on cyrs-diag (spec §3.1), so the
code is carried as a plain u16.
Fields§
§code: u16Numeric discriminant of the corresponding DiagCode in
cyrs-diag (e.g. 4 for E0004).
message: StringHuman-readable message (rustc-style lower-case initial, no trailing period).
range: TextRangeByte range of the offending lexeme.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LexError
impl RefUnwindSafe for LexError
impl Send for LexError
impl Sync for LexError
impl Unpin for LexError
impl UnsafeUnpin for LexError
impl UnwindSafe for LexError
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