tokenizer
This commit is contained in:
16
src/main.rs
Normal file
16
src/main.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
mod tokenizer;
|
||||
|
||||
use std::{env, error::Error, fs};
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let mut args = env::args();
|
||||
let path = args.nth(1).unwrap();
|
||||
|
||||
let source = fs::read_to_string(path.clone())?;
|
||||
|
||||
// TODO: basename
|
||||
let tokenizer = tokenizer::Tokenizer::new(path, source);
|
||||
println!("{:#?}", tokenizer.tokenize()?);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user