Enum rurtle::lex::Token [] [src]

pub enum Token {
    Word(String),
    Number(f32),
    LBracket,
    RBracket,
    LParens,
    RParens,
    Colon,
    String(String),
    OpEq,
    OpLt,
    OpGt,
    OpLe,
    OpGe,
    OpNe,
    OpPlus,
    OpMinus,
    OpMul,
    OpDiv,
    KeyLearn,
    KeyDo,
    KeyElse,
    KeyRepeat,
    KeyWhile,
    KeyIf,
    KeyEnd,
    KeyFor,
    KeyReturn,
    KeyTry,
}

A Token represents a "atom" block of the input source.

Variants

Word

An identifier, also called Word

Number
LBracket

The left bracket [

RBracket

The right bracket ]

LParens

The left parenthesis (

RParens

The right parenthesis )

Colon

The colon :

String

A String enclosed in "quotes"

OpEq

Operator "equals" =

OpLt

Operator "less than" <

OpGt

Operator "greater than" >

OpLe

Operator "less or equal" <=

OpGe

Operator "greater or equal" >=

OpNe

Operator "not equal" <>

OpPlus

Operator "plus" +

OpMinus

Operator "minues" -

OpMul

Operator "multipication" *

OpDiv

Operator "division" /

KeyLearn

Keyword "LEARN"

KeyDo

Keyword "DO"

KeyElse

Keyword "ELSE"

KeyRepeat

Keyword "REPEAT"

KeyWhile

Keyword "WHILE"

KeyIf

Keyword "IF"

KeyEnd

Keyword "END"

KeyFor

Keyword "FOR"

KeyReturn

Keyword "RETURN"

KeyTry

Keyword "TRY"

Trait Implementations

impl Display for Token

fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>

Derived Implementations

impl PartialEq for Token

fn eq(&self, __arg_0: &Token) -> bool

fn ne(&self, __arg_0: &Token) -> bool

impl Clone for Token

fn clone(&self) -> Token

fn clone_from(&mut self, source: &Self)

impl Debug for Token

fn fmt(&self, __arg_0: &mut Formatter) -> Result