read identifier

This commit is contained in:
YannAhlgrim
2026-05-11 16:31:13 +02:00
parent 67df3e744b
commit 75f973a8ec
2 changed files with 36 additions and 7 deletions
+15 -1
View File
@@ -1,6 +1,20 @@
mod lexer;
mod token;
use crate::lexer::LexerTraits;
use lexer::new;
fn main() {
println!("Hello, world!");
let input = "let five = 5;
let ten = 10;
let add = fn(x, y) {
x + y;
};
let result = add(five, ten);";
let mut l = new(input.to_string());
for (i, tok) in (0..10).map(|_| l.next_token()).enumerate() {
println!("{}: {:?}", i, tok.type_);
}
}