pub enum Token {
Number(f64),
Operator(Operation),
LeftParen,
RightParen,
}Expand description
Token types from lexical analysis
Variants§
Number(f64)
Numeric literal
Operator(Operation)
Binary operator
LeftParen
Left parenthesis
RightParen
Right parenthesis
Implementations§
Source§impl Token
impl Token
Sourcepub const fn is_operator(&self) -> bool
pub const fn is_operator(&self) -> bool
Returns true if this token is an operator
Sourcepub const fn is_left_paren(&self) -> bool
pub const fn is_left_paren(&self) -> bool
Returns true if this token is a left parenthesis
Sourcepub const fn is_right_paren(&self) -> bool
pub const fn is_right_paren(&self) -> bool
Returns true if this token is a right parenthesis
Trait Implementations§
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin 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