@@ -1417,7 +1417,7 @@ and fmt_fun ?force_closing_paren
14171417 $ body $ closing
14181418 $ Cmts. fmt_after c ast.pexp_loc )
14191419
1420- and fmt_label_arg ?(box = true ) ?epi ? eol c (lbl , ({ast = arg ; _} as xarg )) =
1420+ and fmt_label_arg ?(box = true ) ?eol c (lbl , ({ast = arg ; _} as xarg )) =
14211421 match (lbl, arg.pexp_desc) with
14221422 | (Labelled l | Optional l), Pexp_ident {txt= Lident i; loc}
14231423 when String. equal l.txt i && List. is_empty arg.pexp_attributes ->
@@ -1435,23 +1435,21 @@ and fmt_label_arg ?(box = true) ?epi ?eol c (lbl, ({ast= arg; _} as xarg)) =
14351435 | Optional _ -> str " ?"
14361436 | Nolabel -> noop
14371437 in
1438- lbl $ fmt_expression c ~box ?epi xarg
1438+ lbl $ fmt_expression c ~box xarg
14391439 | (Labelled _ | Optional _), _ when Cmts. has_after c.cmts xarg.ast.pexp_loc
14401440 ->
14411441 let cmts_after = Cmts. fmt_after c xarg.ast.pexp_loc in
14421442 hvbox_if box 2
14431443 ( hvbox_if box 0
1444- (fmt_expression c
1445- ~pro: (fmt_label lbl " :@;<0 2>" )
1446- ~box ?epi xarg )
1444+ (fmt_expression c ~pro: (fmt_label lbl " :@;<0 2>" ) ~box xarg)
14471445 $ cmts_after )
14481446 | (Labelled _ | Optional _ ), (Pexp_fun _ | Pexp_newtype _ ) ->
14491447 fmt_fun ~box ~label: lbl ~parens: true c xarg
14501448 | _ ->
14511449 let label_sep : s =
14521450 if box || c.conf.fmt_opts.wrap_fun_args.v then " :@," else " :"
14531451 in
1454- fmt_label lbl label_sep $ fmt_expression c ~box ?epi xarg
1452+ fmt_label lbl label_sep $ fmt_expression c ~box xarg
14551453
14561454and expression_width c xe =
14571455 String. length
@@ -1467,15 +1465,15 @@ and fmt_args_grouped ?epi:(global_epi = noop) c ctx args =
14671465 | Pexp_fun _ | Pexp_function _ -> Some false
14681466 | _ -> None
14691467 in
1470- let epi =
1471- match (lbl, last ) with
1472- | _ , true -> None
1473- | Nolabel , _ -> Some ( fits_breaks " " ~hint: (1000 , - 1 ) " " )
1474- | _ -> Some (fits_breaks " " ~hint: ( 1000 , - 3 ) " " )
1468+ let break_after =
1469+ match (ast.pexp_desc, c.conf.fmt_opts.break_string_literals.v ) with
1470+ | Pexp_constant _ , `Auto when not last ->
1471+ fits_breaks " " ~hint: (1000 , - 2 ) " "
1472+ | _ -> noop
14751473 in
14761474 hovbox
14771475 (Params.Indent. fun_args_group c.conf ~lbl ast)
1478- (fmt_label_arg c ?box ?epi (lbl, xarg))
1476+ (fmt_label_arg c ?box (lbl, xarg) $ break_after )
14791477 $ fmt_if_k (not last) (break_unless_newline 1 0 )
14801478 in
14811479 let fmt_args ~first ~last args =
0 commit comments