pub struct SyntaxError {
pub source: String,
pub line: usize,
pub column: usize,
pub offset: usize,
pub expected: HashSet<&'static str>,
}
Expand description
Syntax error during parsing
Fields§
§source: String
Pre-processed source text
line: usize
Line number in the preprocessed source
column: usize
Column number in the preprocessed source
offset: usize
Byte position in the preproccessed source
expected: HashSet<&'static str>
Tokens expected at the error location
Implementations§
Source§impl SyntaxError
impl SyntaxError
Sourcepub fn format_expected(&self, fmt: &mut Formatter<'_>) -> Result
pub fn format_expected(&self, fmt: &mut Formatter<'_>) -> Result
Quoted and comma-separated list of expected tokens
pub fn get_location(&self) -> (Location<'_>, Vec<Location<'_>>)
Trait Implementations§
Source§impl Clone for SyntaxError
impl Clone for SyntaxError
Source§fn clone(&self) -> SyntaxError
fn clone(&self) -> SyntaxError
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 Debug for SyntaxError
impl Debug for SyntaxError
Source§impl Display for SyntaxError
impl Display for SyntaxError
Source§impl From<SyntaxError> for Error
impl From<SyntaxError> for Error
Source§fn from(e: SyntaxError) -> Error
fn from(e: SyntaxError) -> Error
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SyntaxError
impl RefUnwindSafe for SyntaxError
impl Send for SyntaxError
impl Sync for SyntaxError
impl Unpin for SyntaxError
impl UnwindSafe for SyntaxError
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