pub enum Token<'a> {
Show 13 variants
Keyword(Keyword),
Char(ReservedChar),
String(&'a str),
Comment(&'a str),
License(&'a str),
Other(&'a str),
Regex {
regex: &'a str,
is_global: bool,
is_interactive: bool,
},
Condition(Condition),
Operation(Operation),
CreatedVarDecl(String),
CreatedVar(String),
Number(usize),
FloatingNumber(&'a str),
}
Variants§
Keyword(Keyword)
Char(ReservedChar)
String(&'a str)
Comment(&'a str)
License(&'a str)
Other(&'a str)
Regex
Condition(Condition)
Operation(Operation)
CreatedVarDecl(String)
CreatedVar(String)
Number(usize)
FloatingNumber(&'a str)
Implementations§
source§impl<'a> Token<'a>
impl<'a> Token<'a>
pub fn is_comment(&self) -> bool
pub fn is_license(&self) -> bool
pub fn is_reserved_char(&self) -> bool
pub fn get_char(&self) -> Option<ReservedChar>
pub fn eq_char(&self, rc: ReservedChar) -> bool
pub fn eq_operation(&self, ope: Operation) -> bool
pub fn is_operation(&self) -> bool
pub fn eq_condition(&self, cond: Condition) -> bool
pub fn is_condition(&self) -> bool
pub fn is_other(&self) -> bool
pub fn get_other(&self) -> Option<&str>
pub fn is_white_character(&self) -> bool
pub fn is_keyword(&self) -> bool
pub fn get_keyword(&self) -> Option<Keyword>
pub fn is_string(&self) -> bool
pub fn get_string(&self) -> Option<&str>
pub fn is_regex(&self) -> bool
pub fn is_created_var_decl(&self) -> bool
pub fn is_created_var(&self) -> bool
pub fn is_number(&self) -> bool
pub fn is_floating_number(&self) -> bool
Trait Implementations§
source§impl<'a> PartialEq for Token<'a>
impl<'a> PartialEq for Token<'a>
source§impl<'a> PartialOrd for Token<'a>
impl<'a> PartialOrd for Token<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Eq for Token<'a>
impl<'a> StructuralEq for Token<'a>
impl<'a> StructuralPartialEq for Token<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Token<'a>
impl<'a> Send for Token<'a>
impl<'a> Sync for Token<'a>
impl<'a> Unpin for Token<'a>
impl<'a> UnwindSafe for Token<'a>
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