Skip to content

enum

TokenKind

pub enum TokenKind {
    Ident(String),
    Variant(String),
    Str(String),
    Num(f64),
    LParen,
    RParen,
    LBrace,
    RBrace,
    Colon,
    Comma,
    At,
    Bang,
    EqEq,
    NotEq,
    Lt,
    Le,
    Gt,
    Ge,
    Plus,
    Minus,
    Star,
    Slash,
    Percent,
    AndAnd,
    OrOr,
    Coalesce,
    Pipe,
    Arrow,
    LBracket,
    RBracket,
    Dot,
    Equals,
    LArrow,
    Bar,
    Eof,
}

The kinds of token the DSL understands.

Variants

Ident

Ident(String)

Identifier or keyword; may contain - and . after the first char.

Variant

Variant(String)

.ghost: a variant, one of a prop's named choices.

Str

Str(String)

Raw string contents between the quotes (escapes not yet processed).

Num

Num(f64)

A number.

LParen

LParen

(

RParen

RParen

)

LBrace

LBrace

{

RBrace

RBrace

}

Colon

Colon

:

Comma

Comma

,

At

At

@

Bang

Bang

!

EqEq

EqEq

==

NotEq

NotEq

!=

Lt

Lt

<

Le

Le

<=

Gt

Gt

>

Ge

Ge

>=

Plus

Plus

+

Minus

Minus

-

Star

Star

*

Slash

Slash

/

Percent

Percent

%

AndAnd

AndAnd

&&

OrOr

OrOr

||

Coalesce

Coalesce

??

Pipe

Pipe

|>

Arrow

Arrow

->

LBracket

LBracket

[

RBracket

RBracket

]

Dot

Dot

. after ), ] or }: a field of what's before it.

Equals

Equals

= in a declaration: state count = 0.

LArrow

LArrow

<- (with a space after it): count <- count + 1.

Bar

Bar

| in a record update: { t | done: true }.

Eof

Eof

The end of the source.

Methods

describe

pub fn describe(&self) -> String

A short human-readable description used in error messages.

Trait implementations