Enum hematita::ast::lexer::Token [−][src]
pub enum Token {}Show 57 variants
Comment(String), Identifier(String), Integer(i64), String(String), LiteralTrue, LiteralFalse, LiteralNil, Add, Minus, Multiply, Divide, FloorDivide, Modulo, Exponent, BitwiseAnd, BitwiseOr, BitwiseNotOrXOr, ShiftLeft, ShiftRight, Equal, NotEqual, LessThan, LessThanOrEqual, GreaterThan, GreaterThanOrEqual, Assign, Colon, Comma, Period, SemiColon, Concat, Length, OpenParen, CloseParen, OpenCurly, CloseCurly, OpenBracket, CloseBracket, KeywordAnd, KeywordBreak, KeywordDo, KeywordElse, KeywordElseIf, KeywordEnd, KeywordFor, KeywordFunction, KeywordGoto, KeywordIf, KeywordIn, KeywordLocal, KeywordNot, KeywordOr, KeywordRepeat, KeywordReturn, KeywordThen, KeywordUntil, KeywordWhile,
Expand description
A single syntactical unit of Lua code.
Represents identifiers, punctuation, and everythign in between.
Variants
A Lua comment. May or may not include new lines.
Example
-- Hello world! --[[ I am a multiline comment, and you are a cutie. ]]
Tuple Fields of Comment
0: String
An identifier, excluding keywords.
Example
Valid Identifiers
whatLanguageDo
you_like_better
__luaOr_rust12345
Invalid Identifiers
69imMatureIPromise
- Cannot start with a digitwhat_am!i_supposed
- Includes a non word charactertoWriteHere我不知道
- Includes non latin characters
Tuple Fields of Identifier
0: String
An integer.
Tuple Fields of Integer
0: i64
A string.
Example
Valid Strings
"\tPerhaps, I should reference a song?\n"
'All my life I\'ve drowned in adrenaline\nNow my blood runs slow like a seditive'
[[Good song? No? Damn. :( \t\y\e\x\\stuff\vr"""')]]
[===[[[ ]] ]=====] OH BTW THOSE LYRICS ARE NOT LICENSED]===]
Invalid Strings
"I could just write what the error is in here'
- Mismatched quotation'but instead i choose to write this \y'
- Invalid escape sequence[===[everybody asks what the coder doin
but nobody asks how is the coder doin]]
- Mismatched braces
Tuple Fields of String
0: String
The true
keyword.
The false
keyword.
The nil
keyword.
The +
symbol.
The -
symbol.
The *
symbol.
The /
symbol.
The //
symbol.
The %
symbol.
The ^
symbol.
The &
symbol.
The |
symbol.
The ~
symbol.
The <<
symbol.
The >>
symbol.
The ==
symbol.
The ~=
symbol.
The <
symbol.
The <=
symbol.
The >
symbol.
The >=
symbol.
The =
symbol.
The :
symbol.
The ,
symbol.
The .
symbol.
The ;
symbol.
The ..
symbol.
The #
symbol.
The (
symbol.
The )
symbol.
The {
symbol.
The }
symbol.
The [
symbol.
The ]
symbol.
The and
keyword.
The break
keyword.
The do
keyword.
The else
keyword.
The elseif
keyword.
The end
keyword.
The for
keyword.
The function
keyword.
The goto
keyword.
The if
keyword.
The in
keyword.
The local
keyword.
The not
keyword.
The or
keyword.
The repeat
keyword.
The return
keyword.
The then
keyword.
The until
keyword.
The while
keyword.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Token
impl UnwindSafe for Token
Blanket Implementations
Mutably borrows from an owned value. Read more