next token fn

This commit is contained in:
YannAhlgrim
2026-05-10 12:13:16 +02:00
parent 64e9f9c8c5
commit 67df3e744b
2 changed files with 60 additions and 28 deletions
+15 -14
View File
@@ -1,19 +1,20 @@
#[derive(Default)]
pub struct Token {
pub type_: String,
pub literal: String,
}
const ILLEGAL: &str = "ILLEGAL";
const EOF: &str = "EOF";
const IDENT: &str = "IDENT";
const INT: &str = "INT";
const ASSIGN: &str = "=";
const PLUS: &str = "+";
const COMMA: &str = ",";
const SEMICOLON: &str = ";";
const LPAREN: &str = "(";
const RPAREN: &str = ")";
const LBRACE: &str = "{";
const RBRACE: &str = "}";
const FUNCTION: &str = "FUNCTION";
const LET: &str = "LET";
pub const ILLEGAL: &str = "ILLEGAL";
pub const EOF: &str = "EOF";
pub const IDENT: &str = "IDENT";
pub const INT: &str = "INT";
pub const ASSIGN: &str = "=";
pub const PLUS: &str = "+";
pub const COMMA: &str = ",";
pub const SEMICOLON: &str = ";";
pub const LPAREN: &str = "(";
pub const RPAREN: &str = ")";
pub const LBRACE: &str = "{";
pub const RBRACE: &str = "}";
pub const FUNCTION: &str = "FUNCTION";
pub const LET: &str = "LET";