pub struct SyntaxError {
pub line: u32,
pub msg: Vec<u8>,
}Expand description
Syntax error, formatted PUC-style: chunkname:line: msg near 'tok'.
The near part is already baked into msg at construction time.
msg is a raw byte string — PUC 5.1 reports near '\xff'-style errors
with the offending source byte verbatim, and errors.lua 5.1 :20 grep-
matches that pattern. Carrying the message as Vec<u8> lets the lexer
emit those bytes without UTF-8 enforcement getting in the way.
Fields§
§line: u321-based source line where the error was detected.
msg: Vec<u8>Message bytes (PUC-style; may contain non-UTF-8 source bytes).
Implementations§
Source§impl SyntaxError
impl SyntaxError
Trait Implementations§
Source§impl Clone for SyntaxError
impl Clone for SyntaxError
Source§fn clone(&self) -> SyntaxError
fn clone(&self) -> SyntaxError
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 SyntaxError
impl Debug for SyntaxError
Source§impl Display for SyntaxError
impl Display for SyntaxError
impl Eq for SyntaxError
Source§impl Error for SyntaxError
impl Error for SyntaxError
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 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.
Source§impl PartialEq for SyntaxError
impl PartialEq for SyntaxError
Source§fn eq(&self, other: &SyntaxError) -> bool
fn eq(&self, other: &SyntaxError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SyntaxError
Auto Trait Implementations§
impl Freeze for SyntaxError
impl RefUnwindSafe for SyntaxError
impl Send for SyntaxError
impl Sync for SyntaxError
impl Unpin for SyntaxError
impl UnsafeUnpin 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