pub struct TokenDef {
pub name: String,
pub is_extract: bool,
}Expand description
Definition for a token type used by the tokenizer
Each token definiton has a name and a flag to indicate if it should be extracted. Extracted tokens are not used in AST generation (for example, comments), while ignored tokens are completely removed from the rest of the parsing process.
Note that this should not be confused with the Token in the SDK, which is the token data structure at runtime when parsing.
Fields§
§name: StringToken type name
is_extract: boolIf the token type should be extracted
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TokenDef
impl RefUnwindSafe for TokenDef
impl Send for TokenDef
impl Sync for TokenDef
impl Unpin for TokenDef
impl UnwindSafe for TokenDef
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