mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
Correct handling of binop with SpaceAfter in a Body def
This commit is contained in:
parent
51f2cdccf7
commit
7f1b3449a6
10 changed files with 172 additions and 5 deletions
|
@ -1062,7 +1062,7 @@ pub fn fmt_body<'a>(buf: &mut Buf, pattern: &'a Pattern<'a>, body: &'a Expr<'a>,
|
|||
buf.ensure_ends_with_newline();
|
||||
body.format_with_options(buf, Parens::NotNeeded, Newlines::Yes, indent + INDENT);
|
||||
}
|
||||
Expr::Defs(..) | Expr::BinOps(_, _) => {
|
||||
Expr::Defs(..) | Expr::BinOps(..) | Expr::SpaceAfter(&Expr::BinOps(..), _) => {
|
||||
// Binop chains always get a newline. Otherwise you can have things like:
|
||||
//
|
||||
// something = foo
|
||||
|
|
|
@ -1488,7 +1488,6 @@ fn fmt_binops<'a>(
|
|||
buf: &mut Buf,
|
||||
lefts: &'a [(Loc<Expr<'a>>, Loc<BinOp>)],
|
||||
loc_right_side: &'a Loc<Expr<'a>>,
|
||||
|
||||
indent: u16,
|
||||
) {
|
||||
let is_multiline = loc_right_side.value.is_multiline()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue