mirror of https://git.sr.ht/~garritfra/sabre
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
448 B
20 lines
448 B
use std::fs::File; |
|
use std::io::Read; |
|
|
|
mod lexer; |
|
mod parser; |
|
mod util; |
|
|
|
fn main() -> std::io::Result<()> { |
|
let mut file = File::open("examples/hello_world.sb")?; |
|
let mut contents = String::new(); |
|
file.read_to_string(&mut contents)?; |
|
|
|
let tokens = lexer::tokenize(&contents); |
|
// let ast = parser::parse(tokens.into_iter()); |
|
|
|
let program = parser::parse(tokens, Some(contents)); |
|
|
|
println!("{:#?}", program); |
|
Ok(()) |
|
}
|
|
|