mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Fix formatting of Apply nodes with zero args, which the repl generates
This commit is contained in:
parent
9a9b96dc69
commit
f833ac9a6b
1 changed files with 4 additions and 0 deletions
|
@ -894,6 +894,10 @@ pub fn expr_lift_spaces<'a, 'b: 'a>(
|
|||
) -> Spaces<'a, Expr<'a>> {
|
||||
match expr {
|
||||
Expr::Apply(func, args, called_via) => {
|
||||
if args.is_empty() {
|
||||
return expr_lift_spaces(Parens::NotNeeded, arena, &func.value);
|
||||
}
|
||||
|
||||
let func_lifted = expr_lift_spaces(Parens::InApply, arena, &func.value);
|
||||
let args = arena.alloc_slice_copy(args);
|
||||
let mut res = if let Some(last) = args.last_mut() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue