pub enum TokenType {
Keyword(Keyword),
Ident {
start: usize,
end: usize,
},
Num(i32),
Str {
start: usize,
end: usize,
},
Bool(bool),
Comment {
start: usize,
end: usize,
},
Discard,
Punct(Punct),
Term,
}
Expand description
The various types of tokens.
Comments, strings and identifiers keep the range of their values within the source code. The start of that range is the index of the first character of the token. The end is the index after the last character of the token.
Variants§
Implementations§
Trait Implementations§
impl Copy for TokenType
impl StructuralPartialEq for TokenType
Auto Trait Implementations§
impl Freeze for TokenType
impl RefUnwindSafe for TokenType
impl Send for TokenType
impl Sync for TokenType
impl Unpin for TokenType
impl UnwindSafe for TokenType
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