pub enum Token {
Integer(i64),
Whitespace,
Identifier(String),
Decimal(f64),
Keyword(Keyword),
Operator(Operator),
}
Expand description
Represents all possible tokens that can be produced by the lexer
Variants§
Integer(i64)
Integer literals (e.g. 42
)
Whitespace
Whitespace characters (e.g. space, tab, newline)
Identifier(String)
Identifiers (e.g. variable or function names)
Decimal(f64)
Floating point literals (e.g. 3.14
)
Keyword(Keyword)
Language keywords (e.g. while
, if
)
Operator(Operator)
Operators (e.g. +
, !=
)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe 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