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

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.

Value literal token.

Negative literals are Token::Op(Operator::Sub) followed by a positive literal.

Operator token.

Variable token.

Alphanumeric characters only. Not followed by a (.

Function token.

Alphanumeric characters only. Implicitly followed by a (.

Comma token ,.

Used to provide multiple arguments to a function.

Function closing token ).

Trait Implementations

impl<'a> Clone for Token<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> Debug for Token<'a>
[src]

Formats the value using the given formatter.

impl<'a> PartialEq for Token<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.