@@ -1424,7 +1424,7 @@ and pp_print_pexp_function ctxt sep f x =
1424
1424
makes the pretty-printing a bit prettier. *)
1425
1425
match Jane_syntax.Expression. of_ast x with
1426
1426
| Some (Jexp_n_ary_function (params , c , body ), [] ) ->
1427
- function_params_then_body ctxt f params c body ~delimiter: " = "
1427
+ function_params_then_body ctxt f params c body ~delimiter: sep
1428
1428
| Some (Jexp_layout (Lexp_newtype (str , lay , e )), [] ) ->
1429
1429
pp f " @[(type@ %s :@ %a)@]@ %a"
1430
1430
str.txt
@@ -1438,6 +1438,10 @@ and pp_print_pexp_function ctxt sep f x =
1438
1438
match x.pexp_desc with
1439
1439
| Pexp_newtype (str ,e ) ->
1440
1440
pp f " (type@ %s)@ %a" str.txt (pp_print_pexp_function ctxt sep) e
1441
+ | Pexp_fun (a , b , c , body ) ->
1442
+ pp f " %a@;%a"
1443
+ (label_exp ctxt) (a, b, c)
1444
+ (pp_print_pexp_function ctxt sep) body
1441
1445
| _ ->
1442
1446
pp f " %s@;%a" sep (expression ctxt) x
1443
1447
@@ -2023,13 +2027,13 @@ and function_constraint
2023
2027
(core_type ctxt) ty2
2024
2028
2025
2029
and function_params_then_body ctxt f params constraint_ body ~delimiter =
2026
- let pp_params f () =
2030
+ let pp_params f =
2027
2031
match params with
2028
2032
| [] -> ()
2029
2033
| _ :: _ -> pp f " %a@;" (list (function_param ctxt) ~sep: " @ " ) params
2030
2034
in
2031
- pp f " %a %a%s@;%a"
2032
- pp_params ()
2035
+ pp f " %t %a%s@;%a"
2036
+ pp_params
2033
2037
(option (function_constraint ctxt) ~first: " @;" ) constraint_
2034
2038
delimiter
2035
2039
(function_body (under_functionrhs ctxt)) body
@@ -2057,11 +2061,10 @@ and n_ary_function_expr
2057
2061
(function_body ctxt) body
2058
2062
(function_constraint ctxt) constraint_
2059
2063
| _ :: _ , _ ->
2060
- pp f " @[<2>fun@;%a @]"
2061
- (fun f () ->
2064
+ pp f " @[<2>fun@;%t @]"
2065
+ (fun f ->
2062
2066
function_params_then_body
2063
2067
ctxt f params constraint_ body ~delimiter: " ->" )
2064
- ()
2065
2068
2066
2069
let toplevel_phrase f x =
2067
2070
match x with
0 commit comments