Struct nyar_error::SyntaxError
source · pub struct SyntaxError {
pub info: String,
pub except: String,
pub span: FileSpan,
}Fields§
§info: String§except: String§span: FileSpanImplementations§
source§impl SyntaxError
impl SyntaxError
pub fn new(info: impl Into<String>) -> Self
pub fn invalid_integer<S: ToString>(message: S) -> Self
pub fn invalid_decimal<S: ToString>(message: S) -> Self
pub fn with_file(self, file: FileID) -> Self
pub fn with_range(self, range: &Range<u32>) -> Self
pub fn with_span(self, span: FileSpan) -> Self
source§impl SyntaxError
impl SyntaxError
pub fn as_error(self, kind: ReportKind) -> NyarError
pub fn as_report(&self, kind: ReportKind) -> Diagnostic
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 NyarError
impl From<SyntaxError> for NyarError
source§fn from(value: SyntaxError) -> Self
fn from(value: SyntaxError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
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