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
|
// Check for parse errors
|
||||||
if let Err((l, e)) = g {
|
if let Err((l, e)) = g {
|
||||||
write!(
|
write!(
|
||||||
stdout, "{}{}{} {}{}\r\n",
|
stdout, "{}{}{}{}{}{}\r\n",
|
||||||
color::Fg(color::Red),
|
color::Fg(color::Red),
|
||||||
|
style::Bold,
|
||||||
" ".repeat(l.pos + 4),
|
" ".repeat(l.pos + 4),
|
||||||
"^".repeat(l.len),
|
"^".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(),
|
e.to_string(),
|
||||||
color::Fg(color::Reset),
|
color::Fg(color::Reset),
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
return Err(());
|
return Err(());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue