23 lines
546 B
Rust
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(())
|
|
}
|