mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Add boolean flag to Expr::If for indented else statement
This commit is contained in:
parent
00572cbc83
commit
a7afac7ac7
8 changed files with 136 additions and 47 deletions
|
@ -796,7 +796,15 @@ impl<'a> Normalize<'a> for Expr<'a> {
|
|||
Expr::UnaryOp(a, b) => {
|
||||
Expr::UnaryOp(arena.alloc(a.normalize(arena)), b.normalize(arena))
|
||||
}
|
||||
Expr::If(a, b) => Expr::If(a.normalize(arena), arena.alloc(b.normalize(arena))),
|
||||
Expr::If {
|
||||
if_thens,
|
||||
final_else,
|
||||
indented_else,
|
||||
} => Expr::If {
|
||||
if_thens: if_thens.normalize(arena),
|
||||
final_else: arena.alloc(final_else.normalize(arena)),
|
||||
indented_else,
|
||||
},
|
||||
Expr::When(a, b) => Expr::When(arena.alloc(a.normalize(arena)), b.normalize(arena)),
|
||||
Expr::ParensAround(a) => {
|
||||
// The formatter can remove redundant parentheses, so also remove these when normalizing for comparison.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue