pub struct Token {
pub typ: TokenType,
pub literal: String,
pub sub: Sub,
pub index: (i32, i32),
}Fields§
§typ: TokenType§literal: String§sub: Sub§index: (i32, i32)Implementations§
Source§impl Token
impl Token
pub fn new(typ: TokenType, literal: String, sub: Sub, index: (i32, i32)) -> Self
pub fn new_sub(tokens: Vec<Token>, method: SubMethod) -> Self
pub fn new_pointer(i: usize, method: SubMethod) -> Self
pub fn from(literal: String, index: (i32, i32)) -> Self
pub fn empty() -> Self
pub fn to_submethod(&self) -> SubMethod
pub fn unknown_index() -> (i32, i32)
pub fn take_pointer_index(&self) -> Option<usize>
pub fn is_illegal(&self) -> bool
pub fn is_lparen(&self) -> bool
pub fn is_rparen(&self) -> bool
pub fn is_pointer(&self) -> bool
pub fn is_sub_exp(&self) -> bool
pub fn is_power(&self) -> bool
pub fn is_labs(&self) -> bool
pub fn is_rabs(&self) -> bool
pub fn matchto(&self, t: Token) -> bool
Trait Implementations§
Source§impl ChUtils for Token
impl ChUtils for Token
fn is_number(&self) -> bool
fn is_point(&self) -> bool
fn is_plus_or_minus(&self) -> bool
fn is_div_or_prod(&self) -> bool
fn is_operation_sign(&self) -> bool
fn is_parentheses(&self) -> (bool, bool)
fn is_abs(&self) -> (bool, bool)
fn is_percentage(&self) -> bool
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 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