iowo/crates/app/src/main.rs

28 lines
617 B
Rust
Raw Normal View History

use std::fs;
2024-01-15 09:03:55 +01:00
use config::Config;
use welcome_msg::print_startup_msg;
2024-01-12 09:36:30 +01:00
mod config;
#[allow(unused)]
2024-01-12 09:36:30 +01:00
mod error_reporting;
mod welcome_msg;
fn main() {
// TODO: proper error handling across the whole function
// don't forget to also look inside `Config`
2024-01-19 08:54:36 +01:00
let cfg = Config::read();
2024-01-15 09:03:55 +01:00
if cfg.startup_msg {
print_startup_msg();
}
let source = fs::read_to_string(cfg.source).expect("can't find source file");
let ir = ir::from_ron(&source).expect("failed to parse source to graph ir");
let mut machine = cfg.evaluator.pick();
machine.feed(ir);
machine.eval_full();
}