pub struct TokenError {
pub stmt: usize,
pub line: usize,
pub col: usize,
pub msg: String,
pub kind: Option<ParseErrorKind>,
pub diagnostic: Option<Box<Diagnostic>>,
pub hint: Option<String>,
}Expand description
Backend error. Carries the statement index and message; the string
entry points below map it to crate::ParseError. Lowering
failures from the shared lower dispatcher stringify through here
so success paths compare exactly.
Fields§
§stmt: usize§line: usize1-based source line, 0 when unknown (the split loops stamp the
enclosing statement’s line on the way out, so only genuinely
position-less errors stay 0).
col: usize1-based start column of the enclosing statement, 0 when
unknown (stamped alongside line).
msg: String§kind: Option<ParseErrorKind>Lowering failures preserve the dispatcher’s classification
(UnknownCommand, InvalidSyntax, Validation); None means
a parser-native structural failure.
diagnostic: Option<Box<Diagnostic>>Owning keyed diagnostic, when this error wraps a dispatcher
ParseError built via ParseError::from_diagnostic or a
direct check_arg failure carrying its own diagnostic. The
entry points reattach it verbatim so stable keys survive the
token-stream round trip; other parser-native errors leave this
as None and rewrap from the message string as before. Boxed:
diagnostics are cold-path only and TokenError travels by
value in every Result.
hint: Option<String>Structured hint from the wrapped ParseError, when the
dispatcher set one. Reattached alongside the diagnostic so
hint() survives the round trip; parser-native errors leave
this as None.
Trait Implementations§
Source§impl Clone for TokenError
impl Clone for TokenError
Source§impl Debug for TokenError
impl Debug for TokenError
Source§impl Display for TokenError
impl Display for TokenError
impl Eq for TokenError
Source§impl Error for TokenError
impl Error for TokenError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()