mirror of
https://github.com/urinalcaketopper/fddl.git
synced 2025-06-07 05:34:47 +00:00
58 lines
928 B
Rust
58 lines
928 B
Rust
#[derive(Debug, PartialEq, Clone)]
|
|
pub enum Token {
|
|
// Single-character tokens
|
|
LeftParen, // (
|
|
RightParen, // )
|
|
LeftBrace, // {
|
|
RightBrace, // }
|
|
Comma, // ,
|
|
Dot, // .
|
|
Minus, // -
|
|
Plus, // +
|
|
Semicolon, // ;
|
|
Slash, // /
|
|
Star, // *
|
|
Percent, // %
|
|
Equal, // =
|
|
BangEqual, // !=
|
|
EqualEqual, // ==
|
|
Greater, // >
|
|
GreaterEqual, // >=
|
|
Less, // <
|
|
LessEqual, // <=
|
|
Tilde, // ~
|
|
TildeEqual, // ~=
|
|
|
|
// Literals
|
|
Identifier(String),
|
|
StringLiteral(String),
|
|
Number(f64),
|
|
|
|
// Keywords
|
|
And,
|
|
Or,
|
|
If,
|
|
Else,
|
|
True,
|
|
False,
|
|
Let,
|
|
Const,
|
|
Func,
|
|
Return,
|
|
For,
|
|
While,
|
|
Print,
|
|
Pub,
|
|
Sym,
|
|
Module,
|
|
Import,
|
|
|
|
// Comments
|
|
Comment(String),
|
|
|
|
// Errors
|
|
Error(String),
|
|
|
|
EOF,
|
|
}
|