diff --git a/src/main.rs b/src/main.rs index 9aefb5f..48c03bc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,11 @@ fn main_loop() { stdout().flush().unwrap(); let mut input = String::new(); while stdin().read_line(&mut input).unwrap() != 0 { - println!("{}", evalexpr::eval(&input.trim()).unwrap()); + let result = evalexpr::eval(&input.trim()); + match result { + Ok(succ_res) => println!("{}", succ_res), + Err(err) => println!("Error: {}", err) + } input.clear(); print!(">>> "); stdout().flush().unwrap();