Struct commands::tokenizer::Token
[−]
[src]
pub struct Token<'text> { pub text: &'text str, pub token_type: TokenType, pub location: SourceLocation, }
A token from a body of text.
The lifetime parameter 'text
refers to the lifetime
of the body of text that was tokenized, creating this token.
Fields
text | The text of the token. |
token_type | The type of the token ( |
location | The location of the token in the source body of text. |
Methods
impl<'text> Token<'text>
fn new(text: &'text str, token_type: TokenType, location: SourceLocation) -> Token
Construct a Token
. The lifetime parameter 'text
refers
to the lifetime of the text being tokenized.