pub enum Token {
Identifier(String),
Assign,
Plus,
Minus,
Number(f64),
EOF,
}
Expand description
Token module for lexical analysis.
This module defines the tokens used in the R2Rust interpreter and provides functionality for tokenizing input strings. Represents the different types of tokens in the interpreter.
Variants§
Identifier(String)
An identifier, such as variable names.
Assign
Assignment operator (<-
).
Plus
Addition operator (+
).
Minus
Subtraction operator (-
).
Number(f64)
A numeric literal (e.g., integers or floating-point numbers).
EOF
End of file token.
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