2022-07-02 02:25:43 -05:00
|
|
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
|
|
|
|
2022-07-21 06:03:47 -05:00
|
|
|
use web_lisp::{error::Error, parser};
|
2022-07-20 17:56:00 -05:00
|
|
|
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
2022-07-21 06:03:47 -05:00
|
|
|
let src = std::fs::read_to_string(std::env::args().nth(1).ok_or("no filename provided")?)?;
|
|
|
|
|
|
|
|
match parser::read(&src) {
|
2022-07-21 05:32:24 -05:00
|
|
|
Ok(vals) => {
|
|
|
|
for val in vals {
|
|
|
|
println!("{val}");
|
|
|
|
}
|
|
|
|
}
|
2022-07-21 06:03:47 -05:00
|
|
|
Err(errs) => {
|
|
|
|
for err in errs {
|
|
|
|
Error::Parse(err).report(&src)?;
|
|
|
|
}
|
|
|
|
}
|
2022-07-21 05:32:24 -05:00
|
|
|
}
|
2022-07-03 17:55:19 -05:00
|
|
|
|
2022-07-20 17:56:00 -05:00
|
|
|
Ok(())
|
2022-07-02 02:25:43 -05:00
|
|
|
}
|