mirror of https://github.com/rm-dr/daisy
Error tweak
parent
73049eeec4
commit
1671bbbade
|
@ -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(());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue