pub enum TokenKind {
LineComment,
BlockComment,
Whitespace,
LParen,
RParen,
String,
Id,
Keyword,
Reserved,
Integer(IntegerKind),
Float(FloatKind),
}
Expand description
Classification of what was parsed from the input stream.
This enumeration contains all kinds of fragments, including comments and whitespace.
Variants§
LineComment
A line comment, preceded with ;;
BlockComment
A block comment, surrounded by (;
and ;)
. Note that these can be
nested.
Whitespace
A fragment of source that represents whitespace.
LParen
A left-parenthesis, including the source text for where it comes from.
RParen
A right-parenthesis, including the source text for where it comes from.
String
A string literal, which is actually a list of bytes.
Id
An identifier (like $foo
).
All identifiers start with $
and the payload here is the original
source text.
Keyword
A keyword, or something that starts with an alphabetic character.
The payload here is the original source text.
Reserved
A reserved series of idchar
symbols. Unknown what this is meant to be
used for, you’ll probably generate an error about an unexpected token.
Integer(IntegerKind)
An integer.
Float(FloatKind)
A float.