idents and numbers

This commit is contained in:
YannAhlgrim
2026-05-12 16:24:31 +02:00
parent 75f973a8ec
commit a1fc32d7a3
3 changed files with 45 additions and 5 deletions
+10
View File
@@ -1,3 +1,5 @@
use std::collections::HashMap;
#[derive(Default)]
pub struct Token {
pub type_: String,
@@ -18,3 +20,11 @@ pub const LBRACE: &str = "{";
pub const RBRACE: &str = "}";
pub const FUNCTION: &str = "FUNCTION";
pub const LET: &str = "LET";
pub fn lookup_ident(ident: &str) -> &str {
match ident {
"fn" => FUNCTION,
"let" => LET,
_ => ILLEGAL,
}
}