Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/Fmt_ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2302,14 +2302,14 @@ and fmt_expression c ?(box = true) ?(pro = noop) ?eol ?parens
let pro =
intro_epi
$ fmt_if parens (str "(")
$ ( fmt_args_grouped ~epi:fmt_atrs e0 args_before
$ fmt_if parens (closing_paren c ~force ~offset:(-3)) )
$ fmt_args_grouped ~epi:fmt_atrs e0 args_before
in
let label_sep = Params.Exp.fun_label_sep c.conf in
let pro = pro $ break 1 0 $ fmt_label lbl label_sep in
expr_epi
$ hovbox 4
(fmt_expression c ~pro ~box:false (sub_exp ~ctx last_arg))
( fmt_expression c ~pro ~box:false (sub_exp ~ctx last_arg)
$ fmt_if parens (closing_paren c ~force ~offset:(-3)) )
| _ ->
let fmt_atrs =
fmt_attributes c ~pre:(Break (1, -2)) pexp_attributes
Expand Down
6 changes: 6 additions & 0 deletions test/passing/refs.ahrefs/exp_grouping-parens.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -578,3 +578,9 @@ let () =
$ y
in
fooooooooooo x)

let f () =
f
(g a (fun () ->
let x = y in
z))
7 changes: 7 additions & 0 deletions test/passing/refs.ahrefs/exp_grouping.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -662,3 +662,10 @@ let () =
in
fooooooooooo x
end

let f () =
f
(g a begin fun () ->
let x = y in
z
end)
6 changes: 6 additions & 0 deletions test/passing/refs.default/exp_grouping-parens.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -595,3 +595,9 @@ let () =
$ y
in
fooooooooooo x)

let f () =
f
(g a (fun () ->
let x = y in
z))
7 changes: 7 additions & 0 deletions test/passing/refs.default/exp_grouping.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -680,3 +680,10 @@ let () =
in
fooooooooooo x
end

let f () =
f
(g a begin fun () ->
let x = y in
z
end)
7 changes: 7 additions & 0 deletions test/passing/refs.janestreet/exp_grouping-parens.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -677,3 +677,10 @@ let () =
in
fooooooooooo x)
;;

let f () =
f
(g a (fun () ->
let x = y in
z))
;;
8 changes: 8 additions & 0 deletions test/passing/refs.janestreet/exp_grouping.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -765,3 +765,11 @@ let () =
fooooooooooo x
end
;;

let f () =
f
(g a begin fun () ->
let x = y in
z
end)
;;
6 changes: 6 additions & 0 deletions test/passing/refs.ocamlformat/exp_grouping-parens.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -599,3 +599,9 @@ let () =
$ y
in
fooooooooooo x )

let f () =
f
(g a (fun () ->
let x = y in
z ) )
7 changes: 7 additions & 0 deletions test/passing/refs.ocamlformat/exp_grouping.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -686,3 +686,10 @@ let () =
in
fooooooooooo x
end

let f () =
f
(g a begin fun () ->
let x = y in
z
end )
7 changes: 7 additions & 0 deletions test/passing/tests/exp_grouping.ml
Original file line number Diff line number Diff line change
Expand Up @@ -547,3 +547,10 @@ let () =
in
fooooooooooo x
end

let f () =
f
(g a begin fun () ->
let x = y in
z
end )
Loading