pub enum Token {
Keyword(String, (usize, usize)),
Section(String, String, (usize, usize)),
Integer(usize, (usize, usize)),
Float(f64, (usize, usize)),
Symbol(char, String, (usize, usize)),
Ident(String, (usize, usize)),
}Variants§
Keyword(String, (usize, usize))
Section(String, String, (usize, usize))
Integer(usize, (usize, usize))
Float(f64, (usize, usize))
Symbol(char, String, (usize, usize))
Ident(String, (usize, usize))
Implementations§
Source§impl Token
impl Token
pub fn as_string(&self) -> String
pub fn loc(&self) -> (usize, usize)
pub fn is_keyword(&self, keyword: &str) -> Result<(), Box<dyn Error>>
pub fn is_section(&self, name: &str) -> Result<String, Box<dyn Error>>
pub fn is_ident(&self) -> Result<String, Box<dyn Error>>
pub fn is_integer(&self) -> Result<usize, Box<dyn Error>>
pub fn is_float(&self) -> Result<f64, Box<dyn Error>>
pub fn is_symbol(&self, name: &str) -> Result<(), Box<dyn Error>>
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 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