2022-01-21 17:43:50 -06:00
|
|
|
use std::{fs::read_to_string, env::args, path::Path};
|
|
|
|
|
|
|
|
mod util;
|
2022-01-23 15:42:08 -06:00
|
|
|
use util::cover_paren;
|
|
|
|
|
2022-01-21 17:43:50 -06:00
|
|
|
mod parser;
|
2022-01-23 15:42:08 -06:00
|
|
|
use parser::tokenize;
|
2022-01-21 17:43:50 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let args = args().nth(1).expect("No input file");
|
2022-01-23 15:42:08 -06:00
|
|
|
|
|
|
|
let src = cover_paren(read_to_string(&args).unwrap());
|
2022-01-21 17:43:50 -06:00
|
|
|
let _file_name = Path::new(&args).file_stem().unwrap().to_str().unwrap();
|
2022-01-23 15:42:08 -06:00
|
|
|
|
|
|
|
let mut parser = parser::Parser::new(tokenize(&src));
|
|
|
|
let result = parser.parse();
|
|
|
|
println!("{:#?}", result);
|
2022-01-21 17:43:50 -06:00
|
|
|
}
|