diff --git a/examples/example.json5 b/examples/example.json5 index 6a90f8f..d2f3783 100644 --- a/examples/example.json5 +++ b/examples/example.json5 @@ -290,9 +290,10 @@ }, }, + "fn sum(first, second){ return first+second};", "Run function `sum`", - ["fn sum(first, second){ return first+second}; sum(2,2) = ", { sum: [2, 2] }], + ["sum(2, 2) = ", { sum: [2, 2] }], "\nInput a var", { diff --git a/src/main.rs b/src/main.rs index e134adb..b746f52 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,15 +15,16 @@ mod interpreter; use interpreter::Interpreter; fn main() { - // std::panic::set_hook(Box::new(|info| { - // eprint!( - // "{msg}", - // msg = match info.payload().downcast_ref::() { - // None => "Program panicked without a message!", - // Some(x) => x, - // } - // ); - // })); + #[cfg(not(debug_assertions))] + std::panic::set_hook(Box::new(|info| { + eprint!( + "{msg}", + msg = match info.payload().downcast_ref::() { + None => "Program panicked without a message!", + Some(x) => x, + } + ); + })); let start = Instant::now(); let args = Args::parse();