mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +00:00
Don't persist defs if they have errors
This commit is contained in:
parent
60d2d00651
commit
4d8a3ba3d7
4 changed files with 32 additions and 47 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue