From ead1f351a7fb08d8d966dd6288388ed0d18bbb31 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 15 Sep 2025 03:54:24 -0400 Subject: [PATCH] conlang-run: Add Display-formatted errors here too. --- compiler/cl-interpret/examples/conlang-run.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/cl-interpret/examples/conlang-run.rs b/compiler/cl-interpret/examples/conlang-run.rs index 260ef1f..29c3e1e 100644 --- a/compiler/cl-interpret/examples/conlang-run.rs +++ b/compiler/cl-interpret/examples/conlang-run.rs @@ -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> { let mut args = std::env::args(); @@ -46,9 +46,12 @@ fn main() -> Result<(), Box> { }) .collect::, _>>()?; - 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}"); + } } }