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.
22 lines
541 B
22 lines
541 B
use lexer::TokenKind; |
|
use std::fs::File; |
|
use std::io::Read; |
|
|
|
mod lexer; |
|
mod parser; |
|
|
|
fn main() -> std::io::Result<()> { |
|
let mut file = File::open("examples/hello_world.fx")?; |
|
let mut contents = String::new(); |
|
file.read_to_string(&mut contents)?; |
|
|
|
let tokens = lexer::tokenize(&contents); |
|
// let ast = parser::parse(tokens.into_iter()); |
|
|
|
for token in tokens { |
|
if token.kind != TokenKind::Whitespace && token.kind != TokenKind::CarriageReturn { |
|
println!("{:?}", token); |
|
} |
|
} |
|
Ok(()) |
|
}
|
|
|