Don't persist defs if they have errors

This commit is contained in:
Richard Feldman 2022-10-30 03:42:30 -04:00
parent 60d2d00651
commit 4d8a3ba3d7
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
4 changed files with 32 additions and 47 deletions

View file

@ -14,15 +14,9 @@ use roc_target::TargetInfo;
pub struct ReplOutput {
pub expr: String,
pub expr_type: String,
pub var_name: String,
}
pub fn format_answer(
arena: &Bump,
answer: Expr<'_>,
expr_type: String,
var_name: String,
) -> ReplOutput {
pub fn format_answer(arena: &Bump, answer: Expr<'_>, expr_type: String) -> ReplOutput {
let mut expr = roc_fmt::Buf::new_in(arena);
answer.format_with_options(&mut expr, Parens::NotNeeded, Newlines::Yes, 0);
@ -30,7 +24,6 @@ pub fn format_answer(
ReplOutput {
expr: expr.into_bump_str().to_string(),
expr_type,
var_name,
}
}