File tree Expand file tree Collapse file tree 5 files changed +10
-14
lines changed Expand file tree Collapse file tree 5 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -2564,18 +2564,22 @@ and fmt_expression c ?(box = true) ?(pro = noop) ?eol ?parens
2564
2564
&& c.conf.fmt_opts.break_cases.v <> `All
2565
2565
&& c.conf.fmt_opts.break_cases.v <> `Vertical ) ->
2566
2566
let cmts_before = Cmts. fmt_before c ?eol pexp_loc in
2567
+ let pro_outer, pro_inner =
2568
+ if Params.Exp. box_pro_with_match ~ctx0 ~parens then (noop, pro)
2569
+ else (pro, noop)
2570
+ in
2567
2571
(* side effects of Cmts.fmt_before before [fmt_pattern] is important *)
2568
2572
let xpc_rhs = sub_exp ~ctx pc_rhs in
2569
2573
let leading_cmt = Cmts. fmt_before c pc_lhs.ppat_loc in
2570
2574
let parens_here, parens_for_exp =
2571
2575
if c.conf.fmt_opts.leading_nested_match_parens.v then (false , None )
2572
2576
else (parenze_exp xpc_rhs, Some false )
2573
2577
in
2574
- cmts_before $ pro
2578
+ cmts_before $ pro_outer
2575
2579
$ Params.Exp. wrap c.conf ~parens ~disambiguate: true
2576
2580
(hvbox 2
2577
2581
( hvbox 0
2578
- ( str " try"
2582
+ ( hvbox 0 (pro_inner $ str " try" )
2579
2583
$ fmt_extension_suffix c ext
2580
2584
$ fmt_attributes c pexp_attributes
2581
2585
$ break 1 2
Original file line number Diff line number Diff line change @@ -319,9 +319,7 @@ let x =
319
319
match Tbl.find dist_tbl (pv1, pv2) with
320
320
| None ->
321
321
(* FIXME: temporary hack to avoid Jane Street's annoying warnings. *)
322
- begin
323
- [@warning "-3"]
324
- try
322
+ begin [@warning "-3"] try
325
323
let path', dist = Dijkstra.shortest_path pgraph pv1 pv2 in
326
324
let path = unwrap_path path' in
327
325
Tbl.set dist_tbl ~key:(pv1, pv2) ~data:(path, dist);
Original file line number Diff line number Diff line change @@ -375,9 +375,7 @@ let x =
375
375
match Tbl.find dist_tbl (pv1, pv2) with
376
376
| None ->
377
377
(* FIXME: temporary hack to avoid Jane Street's annoying warnings. *)
378
- begin
379
- [@warning "-3"]
380
- try
378
+ begin [@warning "-3"] try
381
379
let path', dist = Dijkstra.shortest_path pgraph pv1 pv2 in
382
380
let path = unwrap_path path' in
383
381
Tbl.set dist_tbl ~key:(pv1, pv2) ~data:(path, dist);
Original file line number Diff line number Diff line change @@ -319,9 +319,7 @@ let x =
319
319
match Tbl.find dist_tbl (pv1, pv2) with
320
320
| None ->
321
321
(* FIXME: temporary hack to avoid Jane Street's annoying warnings. *)
322
- begin
323
- [@warning "-3"]
324
- try
322
+ begin [@warning "-3"] try
325
323
let path', dist = Dijkstra.shortest_path pgraph pv1 pv2 in
326
324
let path = unwrap_path path' in
327
325
Tbl.set dist_tbl ~key:(pv1, pv2) ~data:(path, dist) ;
Original file line number Diff line number Diff line change @@ -375,9 +375,7 @@ let x =
375
375
match Tbl.find dist_tbl (pv1, pv2) with
376
376
| None ->
377
377
(* FIXME: temporary hack to avoid Jane Street's annoying warnings. *)
378
- begin
379
- [@warning "-3"]
380
- try
378
+ begin [@warning "-3"] try
381
379
let path', dist = Dijkstra.shortest_path pgraph pv1 pv2 in
382
380
let path = unwrap_path path' in
383
381
Tbl.set dist_tbl ~key:(pv1, pv2) ~data:(path, dist) ;
You can’t perform that action at this time.
0 commit comments