#[non_exhaustive]pub struct SyntaxErrorEvent<'a> {
pub offending: Option<TokenView<'a>>,
pub line: usize,
pub column: usize,
pub span: Option<Range<usize>>,
pub message: &'a str,
pub error: Option<&'a AntlrError>,
}Expand description
Structured context for one recognizer diagnostic.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.offending: Option<TokenView<'a>>Token the diagnostic is anchored to, when one exists.
Lexer errors have no offending token because the failed match did not produce one.
line: usizeOne-based input line where the diagnostic starts.
column: usizeZero-based column within line where the diagnostic starts.
span: Option<Range<usize>>Half-open UTF-8 byte span of the offending source text.
Custom streams and token sources that cannot resolve byte offsets leave
this as None.
message: &'a strANTLR-compatible diagnostic message without the leading line/column.
error: Option<&'a AntlrError>Recognition error that caused the diagnostic, when one exists.
Trait Implementations§
Source§impl<'a> Clone for SyntaxErrorEvent<'a>
impl<'a> Clone for SyntaxErrorEvent<'a>
Source§fn clone(&self) -> SyntaxErrorEvent<'a>
fn clone(&self) -> SyntaxErrorEvent<'a>
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<'a> Debug for SyntaxErrorEvent<'a>
impl<'a> Debug for SyntaxErrorEvent<'a>
impl<'a> Eq for SyntaxErrorEvent<'a>
Source§impl<'a> From<&'a TokenSourceError> for SyntaxErrorEvent<'a>
impl<'a> From<&'a TokenSourceError> for SyntaxErrorEvent<'a>
Source§fn from(error: &'a TokenSourceError) -> Self
fn from(error: &'a TokenSourceError) -> Self
Converts to this type from the input type.
Source§impl<'a> PartialEq for SyntaxErrorEvent<'a>
impl<'a> PartialEq for SyntaxErrorEvent<'a>
impl<'a> StructuralPartialEq for SyntaxErrorEvent<'a>
Auto Trait Implementations§
impl<'a> !Send for SyntaxErrorEvent<'a>
impl<'a> !Sync for SyntaxErrorEvent<'a>
impl<'a> Freeze for SyntaxErrorEvent<'a>
impl<'a> RefUnwindSafe for SyntaxErrorEvent<'a>
impl<'a> Unpin for SyntaxErrorEvent<'a>
impl<'a> UnsafeUnpin for SyntaxErrorEvent<'a>
impl<'a> UnwindSafe for SyntaxErrorEvent<'a>
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