move Token out of lexer
This commit is contained in:
parent
ad7a8ad879
commit
a4eed5214e
3 changed files with 24 additions and 22 deletions
22
src/token.rs
Normal file
22
src/token.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#[derive(Debug, PartialEq)]
|
||||
pub enum Token {
|
||||
Number(i64),
|
||||
Ident(String),
|
||||
|
||||
// Operators
|
||||
Add,
|
||||
Sub,
|
||||
Mul,
|
||||
Div,
|
||||
Mod,
|
||||
|
||||
// Parentheses
|
||||
LParen,
|
||||
RParen,
|
||||
LBrace,
|
||||
RBrace,
|
||||
LBracket,
|
||||
RBracket,
|
||||
|
||||
Semicolon
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue