@@ -222,10 +222,10 @@ let fmt_item_list c ctx0 update_config ast fmt_item items =
222222 let loc = Ast. location ctx in
223223 maybe_disabled c loc [] (fun c -> fmt_item c ctx ~prev ~next itm)
224224 $ opt next (fun (i_n , c_n ) ->
225- fmt_or
226- (break_between c (ctx, c.conf) (ast i_n, c_n.conf))
227- (str " \n " $ force_break)
228- (fmt_or break_struct force_break space_break) )
225+ fmt_or
226+ (break_between c (ctx, c.conf) (ast i_n, c_n.conf))
227+ (str " \n " $ force_break)
228+ (fmt_or break_struct force_break space_break) )
229229
230230let fmt_recmodule c ctx items fmt_item ast sub =
231231 let update_config c i = update_config c (Ast. attributes (ast i)) in
@@ -462,7 +462,7 @@ let fmt_docstring_around_item' ?(is_val = false) ?(force_before = false)
462462 let floating_doc, doc =
463463 doc
464464 |> List. map ~f: (fun (({txt; loc} , _ ) as doc ) ->
465- (Docstring. parse ~loc txt, doc) )
465+ (Docstring. parse ~loc txt, doc) )
466466 |> List. partition_tf ~f: (fun (_ , (_ , floating )) -> floating)
467467 in
468468 let placement =
@@ -849,8 +849,8 @@ and fmt_core_type c ?(box = true) ?pro ?(pro_space = true) ?constraint_ctx
849849 update_config_maybe_disabled c ptyp_loc ptyp_attributes
850850 @@ fun c ->
851851 ( match pro with
852- | Some pro -> fmt_constraint_sep ~pro_space c pro
853- | None -> noop )
852+ | Some pro -> fmt_constraint_sep ~pro_space c pro
853+ | None -> noop )
854854 $
855855 let doc, atrs = doc_atrs ptyp_attributes in
856856 Cmts. fmt c ptyp_loc
@@ -1116,8 +1116,8 @@ and fmt_pattern ?ext c ?pro ?parens ?(box = false)
11161116 let parens = match parens with Some b -> b | None -> parenze_pat xpat in
11171117 (match ctx0 with Pat {ppat_desc = Ppat_tuple _ ; _} -> hvbox 0 | _ -> Fn. id)
11181118 @@ ( match ppat_desc with
1119- | Ppat_or _ -> fun k -> Cmts. fmt c ppat_loc @@ k
1120- | _ -> fun k -> Cmts. fmt c ppat_loc @@ (fmt_opt pro $ k) )
1119+ | Ppat_or _ -> fun k -> Cmts. fmt c ppat_loc @@ k
1120+ | _ -> fun k -> Cmts. fmt c ppat_loc @@ (fmt_opt pro $ k) )
11211121 @@ hovbox_if box 0
11221122 @@ fmt_pattern_attributes c xpat
11231123 @@
@@ -1495,7 +1495,7 @@ and fmt_indexop_access c ctx ~fmt_atrs ~has_attr ~parens x =
14951495 (str " ;" $ space_break)
14961496 (sub_exp ~ctx >> fmt_expression c) ) )
14971497 $ opt pia_rhs (fun e ->
1498- fmt_assign_arrow c $ fmt_expression c (sub_exp ~ctx e) ) )
1498+ fmt_assign_arrow c $ fmt_expression c (sub_exp ~ctx e) ) )
14991499 $ fmt_atrs ) )
15001500
15011501(* * Format a [Pexp_function]. [wrap_intro] wraps up to after the [->] and is
@@ -1873,7 +1873,7 @@ and fmt_infix_op_args c ~parens xexp op_args =
18731873 ((not very_last) && exposed_right_exp Ast. Non_apply xarg.ast)
18741874 || parenze_exp xarg
18751875 in
1876- if Params.Exp.Infix_op_arg. dock c.conf xarg then
1876+ if Params.Exp.Infix_op_arg. dock xarg then
18771877 (* Indentation of docked fun or function start before the operator. *)
18781878 hovbox ~name: " Infix_op_arg docked" 2
18791879 (fmt_expression c ~parens ~box: false ~pro xarg)
@@ -2247,8 +2247,7 @@ and fmt_expression c ?(box = true) ?(pro = noop) ?eol ?parens
22472247 parenthesis. *)
22482248 let dock_fun_arg =
22492249 (* Do not dock the arguments when there's more than one. *)
2250- (not c.conf.fmt_opts.ocp_indent_compat.v)
2251- || Location. line_difference e0.pexp_loc last_arg.pexp_loc = 0
2250+ Location. line_difference e0.pexp_loc last_arg.pexp_loc = 0
22522251 in
22532252 if parens || not dock_fun_arg then (noop, pro) else (pro, noop)
22542253 in
@@ -2693,8 +2692,8 @@ and fmt_expression c ?(box = true) ?(pro = noop) ?eol ?parens
26932692 ( fmt_pattern c ~pro: (if_newline " | " )
26942693 (sub_pat ~ctx pc_lhs)
26952694 $ opt pc_guard (fun g ->
2696- space_break $ str " when "
2697- $ fmt_expression c (sub_exp ~ctx g) )
2695+ space_break $ str " when "
2696+ $ fmt_expression c (sub_exp ~ctx g) )
26982697 $ space_break $ str " ->"
26992698 $ fmt_if parens_here (str " (" ) ) )
27002699 $ break 1 2
@@ -3381,8 +3380,8 @@ and fmt_case c ctx ~first ~last case =
33813380 ( hvbox 0
33823381 ( fmt_pattern c ~pro: p.bar ~parens: paren_lhs xlhs
33833382 $ opt pc_guard (fun g ->
3384- break 1 2 $ str " when "
3385- $ fmt_expression c (sub_exp ~ctx g) ) )
3383+ break 1 2 $ str " when " $ fmt_expression c (sub_exp ~ctx g) )
3384+ )
33863385 $ p.break_before_arrow $ str " ->" $ p.break_after_arrow
33873386 $ p.open_paren_branch )
33883387 $ p.break_after_opening_paren
@@ -3714,9 +3713,9 @@ and fmt_type_extension c ctx
37143713 $ str " +="
37153714 $ fmt_private_flag c ptyext_private
37163715 $ list_fl ptyext_constructors (fun ~first ~last :_ x ->
3717- let bar_fits = if first then " " else " | " in
3718- cbreak ~fits: (" " , 1 , bar_fits) ~breaks: (" " , 0 , " | " )
3719- $ fmt_ctor x ) )
3716+ let bar_fits = if first then " " else " | " in
3717+ cbreak ~fits: (" " , 1 , bar_fits) ~breaks: (" " , 0 , " | " )
3718+ $ fmt_ctor x ) )
37203719 $ fmt_item_attributes c ~pre: (Break (1 , 0 )) attrs_after )
37213720
37223721and fmt_type_exception ~pre c ctx
@@ -4028,46 +4027,46 @@ and fmt_class_types c ~pre ~sep cls =
40284027and fmt_class_exprs c cls =
40294028 hvbox 0
40304029 @@ list_fl cls (fun ~first ~last :_ cl ->
4031- update_config_maybe_disabled_attrs c cl.pci_loc cl.pci_attributes
4032- @@ fun c ->
4033- let ctx = Cd cl in
4034- let xargs = cl.pci_args in
4035- let ext = cl.pci_attributes.attrs_extension in
4036- let doc_before, doc_after, attrs_before, attrs_after =
4037- let force_before = not (Cl. is_simple cl.pci_expr) in
4038- fmt_docstring_around_item_attrs ~force_before c cl.pci_attributes
4039- in
4040- let class_expr =
4041- let pro =
4042- box_fun_decl_args c 2
4043- ( hovbox 2
4044- ( str (if first then " class" else " and" )
4045- $ fmt_if first (fmt_extension_suffix c ext)
4046- $ fmt_attributes c ~pre: (Break (1 , 0 )) attrs_before
4047- $ fmt_virtual_flag c cl.pci_virt
4048- $ space_break
4049- $ fmt_class_params c ctx cl.pci_params
4050- $ fmt_str_loc c cl.pci_name )
4051- $ fmt_if (not (List. is_empty xargs)) space_break
4052- $ wrap_fun_decl_args c (fmt_class_fun_args c xargs) )
4053- in
4054- let intro =
4055- match cl.pci_constraint with
4056- | Some ty ->
4057- fmt_class_type c
4058- ~pro: (pro $ str " :" $ space_break)
4059- (sub_cty ~ctx ty)
4060- | None -> pro
4061- in
4062- hovbox 2
4063- ( hovbox 2 (intro $ space_break $ str " =" )
4064- $ space_break
4065- $ fmt_class_expr c (sub_cl ~ctx cl.pci_expr) )
4066- $ fmt_item_attributes c ~pre: (Break (1 , 0 )) attrs_after
4067- in
4068- fmt_if (not first) (str " \n " $ force_break)
4069- $ hovbox 0
4070- @@ Cmts. fmt c cl.pci_loc (doc_before $ class_expr $ doc_after) )
4030+ update_config_maybe_disabled_attrs c cl.pci_loc cl.pci_attributes
4031+ @@ fun c ->
4032+ let ctx = Cd cl in
4033+ let xargs = cl.pci_args in
4034+ let ext = cl.pci_attributes.attrs_extension in
4035+ let doc_before, doc_after, attrs_before, attrs_after =
4036+ let force_before = not (Cl. is_simple cl.pci_expr) in
4037+ fmt_docstring_around_item_attrs ~force_before c cl.pci_attributes
4038+ in
4039+ let class_expr =
4040+ let pro =
4041+ box_fun_decl_args c 2
4042+ ( hovbox 2
4043+ ( str (if first then " class" else " and" )
4044+ $ fmt_if first (fmt_extension_suffix c ext)
4045+ $ fmt_attributes c ~pre: (Break (1 , 0 )) attrs_before
4046+ $ fmt_virtual_flag c cl.pci_virt
4047+ $ space_break
4048+ $ fmt_class_params c ctx cl.pci_params
4049+ $ fmt_str_loc c cl.pci_name )
4050+ $ fmt_if (not (List. is_empty xargs)) space_break
4051+ $ wrap_fun_decl_args c (fmt_class_fun_args c xargs) )
4052+ in
4053+ let intro =
4054+ match cl.pci_constraint with
4055+ | Some ty ->
4056+ fmt_class_type c
4057+ ~pro: (pro $ str " :" $ space_break)
4058+ (sub_cty ~ctx ty)
4059+ | None -> pro
4060+ in
4061+ hovbox 2
4062+ ( hovbox 2 (intro $ space_break $ str " =" )
4063+ $ space_break
4064+ $ fmt_class_expr c (sub_cl ~ctx cl.pci_expr) )
4065+ $ fmt_item_attributes c ~pre: (Break (1 , 0 )) attrs_after
4066+ in
4067+ fmt_if (not first) (str " \n " $ force_break)
4068+ $ hovbox 0
4069+ @@ Cmts. fmt c cl.pci_loc (doc_before $ class_expr $ doc_after) )
40714070
40724071and fmt_module c ctx ?rec_ ?epi ?(can_sparse = false ) keyword ?(eqty = " =" )
40734072 name xargs xbody xmty ~attrs ~rec_flag =
@@ -4165,13 +4164,13 @@ and fmt_module c ctx ?rec_ ?epi ?(can_sparse = false) keyword ?(eqty = "=")
41654164 $ fmt_item_attributes c ~pre: (Break (1 , 0 )) attrs_after
41664165 $ doc_after
41674166 $ opt epi (fun epi ->
4168- fmt_or compact
4169- (fmt_or
4170- ( Option. is_some blk_b.epi
4171- && not c.conf.fmt_opts.ocp_indent_compat.v )
4172- (str " " ) space_break )
4173- (break 1 (- 2 ))
4174- $ epi ) )
4167+ fmt_or compact
4168+ (fmt_or
4169+ ( Option. is_some blk_b.epi
4170+ && not c.conf.fmt_opts.ocp_indent_compat.v )
4171+ (str " " ) space_break )
4172+ (break 1 (- 2 ))
4173+ $ epi ) )
41754174
41764175and fmt_module_declaration c ~rec_flag ~first {ast = pmd ; _} =
41774176 protect c (Md pmd)
0 commit comments