conlang-run: Add Display-formatted errors here too.

This commit is contained in:
John 2025-09-15 03:54:24 -04:00
parent 986bac9e6b
commit ead1f351a7

View File

@ -5,7 +5,7 @@ use std::{error::Error, path::PathBuf};
use cl_ast::Expr;
use cl_interpret::{convalue::ConValue, env::Environment};
use cl_lexer::Lexer;
use cl_parser::{inliner::ModuleInliner, Parser};
use cl_parser::{Parser, inliner::ModuleInliner};
fn main() -> Result<(), Box<dyn Error>> {
let mut args = std::env::args();
@ -46,9 +46,12 @@ fn main() -> Result<(), Box<dyn Error>> {
})
.collect::<Result<Vec<_>, _>>()?;
match env.call(main, &args)? {
ConValue::Empty => {}
retval => println!("{retval}"),
match env.call(main, &args) {
Ok(ConValue::Empty) => {}
Ok(retval) => println!("{retval}"),
Err(e) => {
panic!("{e}");
}
}
}