Enum lucia_lang::token::TokenKind
source · pub enum TokenKind {
Show 60 variants
If,
Else,
Loop,
While,
For,
In,
Break,
Continue,
Return,
Throw,
Global,
Import,
As,
Is,
Not,
And,
Or,
Try,
Fn,
Do,
Null,
True,
False,
DoubleColon,
Eq,
NotEq,
LtEq,
GtEq,
AddAssign,
SubAssign,
MulAssign,
DivAssign,
ModAssign,
Comma,
Dot,
OpenParen,
CloseParen,
OpenBrace,
CloseBrace,
OpenBracket,
CloseBracket,
Pound,
Question,
Colon,
Assign,
Lt,
Gt,
VBar,
Add,
Sub,
Mul,
Div,
Mod,
EOL,
LineComment,
BlockComment,
Whitespace,
Ident(String),
Literal(LiteralKind),
Unknown(char),
}Expand description
Enum representing common lexeme types.
Variants§
If
“if”
Else
“else”
Loop
“lopp”
While
“while”
For
“for”
In
“in”
Break
“break”
Continue
“continue”
Return
“return”
Throw
“throw”
Global
“global”
Import
“import”
As
“as”
Is
“is”
Not
“not”
And
“and”
Or
“or”
Try
“try”
Fn
“fn”
Do
“do”
Null
“null”
True
“true”
False
“false”
DoubleColon
“::”
Eq
“==”
NotEq
“!=”
LtEq
“<=”
GtEq
“>=”
AddAssign
“+=”
SubAssign
“-=”
MulAssign
“*=”
DivAssign
“/=”
ModAssign
“%=”
Comma
“,”
Dot
“.”
OpenParen
“(”
CloseParen
“)”
OpenBrace
“{”
CloseBrace
“}”
OpenBracket
“[”
CloseBracket
“]”
Pound
“#”
Question
“?”
Colon
“:”
Assign
“=”
Lt
“<”
Gt
“>”
VBar
“|”
Add
“+”
Sub
“-”
Mul
“*”
Div
“/”
Mod
“%”
EOL
End of line (\n)
LineComment
“// comment”
BlockComment
“/* block comment */”
Block comments can be recursive, so the sequence like /* /* */
will not be considered terminated and will result in a parsing error.
Whitespace
Any whitespace characters sequence.
Ident(String)
Ident
Literal(LiteralKind)
“12”, “1.0e-40”, ““123”“. See LiteralKind for more details.
Unknown(char)
Unknown token, not expected by the lexer, e.g. “№”