Enum pupil::lexer::Token
[−]
[src]
pub enum Token<'a> { Unk(&'a str), Lit(Value), Op(Operator), Var(&'a str), Open(&'a str), Comma, Close, }
Supported tokens types.
Variants
Unk(&'a str)
Unknown token.
It’s the caller’s responsibility to handle this with an error of some kind.
This will swallow the entire remainder of the input, such that the tokenization finishes on next iteration.
Lit(Value)
Value literal token.
Negative literals are Token::Op(Operator::Sub)
followed by a positive literal.
Op(Operator)
Operator token.
Var(&'a str)
Variable token.
Alphanumeric characters only. Not followed by a (
.
Open(&'a str)
Function token.
Alphanumeric characters only. Implicitly followed by a (
.
Comma
Comma token ,
.
Used to provide multiple arguments to a function.
Close
Function closing token )
.
Trait Implementations
impl<'a> Clone for Token<'a>
[src]
fn clone(&self) -> Token<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more