Start work on lexer for macro language

This commit is contained in:
2024-04-28 18:13:54 -07:00
parent 4363fd04ac
commit 669bcbfcb7
4 changed files with 383 additions and 0 deletions
+4
View File
@@ -1,8 +1,11 @@
mod lang;
mod world;
use std::{env, error::Error, fs, process::exit};
use world::World;
use crate::lang::scan;
fn to_latin1(bytes: &[u8]) -> String {
bytes.iter().map(|&x| x as char).collect()
}
@@ -32,6 +35,7 @@ fn main() -> Result<(), Box<dyn Error>> {
board.terrain[(x - 1) + (y - 1) * 60],
to_latin1(&stat.code)
);
scan("todo: convert [u8] to strings and scan here");
}
}