pub struct Token {
pub kind: i32,
pub value: TokenValue,
}Expand description
A single lexed token with its semantic payload.
kind is an i32 whose value is either an ASCII byte code (for single-byte
tokens like +, -, [) or one of the TK_* constants (for reserved
words, multi-char symbols, and literals).
The i32 kind is the cross-crate boundary: lua-parse and the error
formatters consume these TK_* codes directly, so it stays an integer by
design rather than a typed enum. The lexer’s own scan loop does its
dispatch on the internal [Peek] enum instead — the typed-match lives
inside the lexer, the integer codes cross the boundary.
Fields§
§kind: i32§value: TokenValueImplementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Token
impl !Send for Token
impl !Sync for Token
impl !UnwindSafe for Token
impl Freeze for Token
impl Unpin for Token
impl UnsafeUnpin for Token
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