Error tweak

pull/2/head
Mark 2023-06-17 19:39:45 -07:00
parent 73049eeec4
commit 1671bbbade
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 12 additions and 1 deletions

View File

@ -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(());
}