stuff
This commit is contained in:
+10
-8
@@ -1,3 +1,6 @@
|
||||
use crate::{io::CompilerOutput, parser::Nodes};
|
||||
|
||||
mod io;
|
||||
mod parser;
|
||||
|
||||
fn main() {
|
||||
@@ -6,12 +9,11 @@ fn main() {
|
||||
println!("file expected");
|
||||
return;
|
||||
};
|
||||
let code = match std::fs::read_to_string(path) {
|
||||
Ok(code) => code,
|
||||
Err(err) => {
|
||||
println!("Failed to read input file: {err}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
parser::parse(&code);
|
||||
let mut output = CompilerOutput::new();
|
||||
let nodes = Nodes::parse_root(&path, &mut output);
|
||||
if let Some((nodes, root)) = nodes {
|
||||
nodes.format(&mut std::io::stdout(), root).unwrap();
|
||||
println!();
|
||||
}
|
||||
output.write(&mut std::io::stdout());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user