wisp/src/main.rs
2022-07-21 13:03:47 +02:00

23 lines
546 B
Rust

#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use web_lisp::{error::Error, parser};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let src = std::fs::read_to_string(std::env::args().nth(1).ok_or("no filename provided")?)?;
match parser::read(&src) {
Ok(vals) => {
for val in vals {
println!("{val}");
}
}
Err(errs) => {
for err in errs {
Error::Parse(err).report(&src)?;
}
}
}
Ok(())
}