pub struct TokenIssue<'a> {
pub level: IssueLevel,
pub message: String,
pub span: &'a str,
pub line: usize,
pub column: usize,
}Expand description
Tokenization issue for error reporting
Represents a problem encountered during tokenization with location information and severity level for appropriate handling.
Fields§
§level: IssueLevelIssue severity level
message: StringHuman-readable error message
span: &'a strSource span where issue occurred
line: usizeLine number where issue occurred (1-based)
column: usizeColumn number where issue occurred (1-based)
Implementations§
Source§impl<'a> TokenIssue<'a>
impl<'a> TokenIssue<'a>
Sourcepub const fn new(
level: IssueLevel,
message: String,
span: &'a str,
line: usize,
column: usize,
) -> Self
pub const fn new( level: IssueLevel, message: String, span: &'a str, line: usize, column: usize, ) -> Self
Create new tokenization issue
§Arguments
level- Severity level of the issuemessage- Human-readable descriptionspan- Source text span where issue occurredline- Line number (1-based)column- Column number (1-based)
Sourcepub const fn warning(
message: String,
span: &'a str,
line: usize,
column: usize,
) -> Self
pub const fn warning( message: String, span: &'a str, line: usize, column: usize, ) -> Self
Create warning issue
Sourcepub const fn error(
message: String,
span: &'a str,
line: usize,
column: usize,
) -> Self
pub const fn error( message: String, span: &'a str, line: usize, column: usize, ) -> Self
Create error issue
Sourcepub const fn critical(
message: String,
span: &'a str,
line: usize,
column: usize,
) -> Self
pub const fn critical( message: String, span: &'a str, line: usize, column: usize, ) -> Self
Create critical issue
Sourcepub fn location_string(&self) -> String
pub fn location_string(&self) -> String
Get formatted location string
Sourcepub fn format_issue(&self) -> String
pub fn format_issue(&self) -> String
Get formatted issue string for display
Trait Implementations§
Source§impl<'a> Clone for TokenIssue<'a>
impl<'a> Clone for TokenIssue<'a>
Source§fn clone(&self) -> TokenIssue<'a>
fn clone(&self) -> TokenIssue<'a>
Returns a duplicate 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<'a> Debug for TokenIssue<'a>
impl<'a> Debug for TokenIssue<'a>
Source§impl<'a> PartialEq for TokenIssue<'a>
impl<'a> PartialEq for TokenIssue<'a>
impl<'a> Eq for TokenIssue<'a>
impl<'a> StructuralPartialEq for TokenIssue<'a>
Auto Trait Implementations§
impl<'a> Freeze for TokenIssue<'a>
impl<'a> RefUnwindSafe for TokenIssue<'a>
impl<'a> Send for TokenIssue<'a>
impl<'a> Sync for TokenIssue<'a>
impl<'a> Unpin for TokenIssue<'a>
impl<'a> UnwindSafe for TokenIssue<'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