From 1671bbbadee102901fd040c5e706fa9801907f94 Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 17 Jun 2023 19:39:45 -0700 Subject: [PATCH] Error tweak --- src/entry/unix/unix.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/entry/unix/unix.rs b/src/entry/unix/unix.rs index aa29a0a..35b7335 100644 --- a/src/entry/unix/unix.rs +++ b/src/entry/unix/unix.rs @@ -35,13 +35,24 @@ fn do_expression( // Check for parse errors if let Err((l, e)) = g { write!( - stdout, "{}{}{} {}{}\r\n", + stdout, "{}{}{}{}{}{}\r\n", color::Fg(color::Red), + style::Bold, " ".repeat(l.pos + 4), "^".repeat(l.len), + color::Fg(color::Reset), + style::Reset, + ).unwrap(); + + write!( + stdout, " {}{}Parse Error: {}{}{}\r\n\n", + style::Bold, + color::Fg(color::Red), + style::Reset, e.to_string(), color::Fg(color::Reset), ).unwrap(); + return Err(()); }