@@ -222,10 +222,10 @@ let fmt_item_list c ctx0 update_config ast fmt_item items =
222
222
let loc = Ast. location ctx in
223
223
maybe_disabled c loc [] (fun c -> fmt_item c ctx ~prev ~next itm)
224
224
$ 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) )
229
229
230
230
let fmt_recmodule c ctx items fmt_item ast sub =
231
231
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)
462
462
let floating_doc, doc =
463
463
doc
464
464
|> List. map ~f: (fun (({txt; loc} , _ ) as doc ) ->
465
- (Docstring. parse ~loc txt, doc) )
465
+ (Docstring. parse ~loc txt, doc) )
466
466
|> List. partition_tf ~f: (fun (_ , (_ , floating )) -> floating)
467
467
in
468
468
let placement =
@@ -849,8 +849,8 @@ and fmt_core_type c ?(box = true) ?pro ?(pro_space = true) ?constraint_ctx
849
849
update_config_maybe_disabled c ptyp_loc ptyp_attributes
850
850
@@ fun c ->
851
851
( 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 )
854
854
$
855
855
let doc, atrs = doc_atrs ptyp_attributes in
856
856
Cmts. fmt c ptyp_loc
@@ -1116,8 +1116,8 @@ and fmt_pattern ?ext c ?pro ?parens ?(box = false)
1116
1116
let parens = match parens with Some b -> b | None -> parenze_pat xpat in
1117
1117
(match ctx0 with Pat {ppat_desc = Ppat_tuple _ ; _} -> hvbox 0 | _ -> Fn. id)
1118
1118
@@ ( 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) )
1121
1121
@@ hovbox_if box 0
1122
1122
@@ fmt_pattern_attributes c xpat
1123
1123
@@
@@ -1495,7 +1495,7 @@ and fmt_indexop_access c ctx ~fmt_atrs ~has_attr ~parens x =
1495
1495
(str " ;" $ space_break)
1496
1496
(sub_exp ~ctx >> fmt_expression c) ) )
1497
1497
$ 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) ) )
1499
1499
$ fmt_atrs ) )
1500
1500
1501
1501
(* * 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 =
1873
1873
((not very_last) && exposed_right_exp Ast. Non_apply xarg.ast)
1874
1874
|| parenze_exp xarg
1875
1875
in
1876
- if Params.Exp.Infix_op_arg. dock c.conf xarg then
1876
+ if Params.Exp.Infix_op_arg. dock xarg then
1877
1877
(* Indentation of docked fun or function start before the operator. *)
1878
1878
hovbox ~name: " Infix_op_arg docked" 2
1879
1879
(fmt_expression c ~parens ~box: false ~pro xarg)
@@ -2311,8 +2311,7 @@ and fmt_expression c ?(box = true) ?(pro = noop) ?eol ?parens
2311
2311
parenthesis. *)
2312
2312
let dock_fun_arg =
2313
2313
(* Do not dock the arguments when there's more than one. *)
2314
- (not c.conf.fmt_opts.ocp_indent_compat.v)
2315
- || Location. line_difference e0.pexp_loc last_arg.pexp_loc = 0
2314
+ Location. line_difference e0.pexp_loc last_arg.pexp_loc = 0
2316
2315
in
2317
2316
if parens || not dock_fun_arg then (noop, pro) else (pro, noop)
2318
2317
in
@@ -2757,8 +2756,8 @@ and fmt_expression c ?(box = true) ?(pro = noop) ?eol ?parens
2757
2756
( fmt_pattern c ~pro: (if_newline " | " )
2758
2757
(sub_pat ~ctx pc_lhs)
2759
2758
$ opt pc_guard (fun g ->
2760
- space_break $ str " when "
2761
- $ fmt_expression c (sub_exp ~ctx g) )
2759
+ space_break $ str " when "
2760
+ $ fmt_expression c (sub_exp ~ctx g) )
2762
2761
$ space_break $ str " ->"
2763
2762
$ fmt_if parens_here (str " (" ) ) )
2764
2763
$ break 1 2
@@ -3445,8 +3444,8 @@ and fmt_case c ctx ~first ~last case =
3445
3444
( hvbox 0
3446
3445
( fmt_pattern c ~pro: p.bar ~parens: paren_lhs xlhs
3447
3446
$ opt pc_guard (fun g ->
3448
- break 1 2 $ str " when "
3449
- $ fmt_expression c (sub_exp ~ctx g) ) )
3447
+ break 1 2 $ str " when " $ fmt_expression c (sub_exp ~ctx g) )
3448
+ )
3450
3449
$ p.break_before_arrow $ str " ->" $ p.break_after_arrow
3451
3450
$ p.open_paren_branch )
3452
3451
$ p.break_after_opening_paren
@@ -3778,9 +3777,9 @@ and fmt_type_extension c ctx
3778
3777
$ str " +="
3779
3778
$ fmt_private_flag c ptyext_private
3780
3779
$ list_fl ptyext_constructors (fun ~first ~last :_ x ->
3781
- let bar_fits = if first then " " else " | " in
3782
- cbreak ~fits: (" " , 1 , bar_fits) ~breaks: (" " , 0 , " | " )
3783
- $ fmt_ctor x ) )
3780
+ let bar_fits = if first then " " else " | " in
3781
+ cbreak ~fits: (" " , 1 , bar_fits) ~breaks: (" " , 0 , " | " )
3782
+ $ fmt_ctor x ) )
3784
3783
$ fmt_item_attributes c ~pre: (Break (1 , 0 )) attrs_after )
3785
3784
3786
3785
and fmt_type_exception ~pre c ctx
@@ -4092,46 +4091,46 @@ and fmt_class_types c ~pre ~sep cls =
4092
4091
and fmt_class_exprs c cls =
4093
4092
hvbox 0
4094
4093
@@ list_fl cls (fun ~first ~last :_ cl ->
4095
- update_config_maybe_disabled_attrs c cl.pci_loc cl.pci_attributes
4096
- @@ fun c ->
4097
- let ctx = Cd cl in
4098
- let xargs = cl.pci_args in
4099
- let ext = cl.pci_attributes.attrs_extension in
4100
- let doc_before, doc_after, attrs_before, attrs_after =
4101
- let force_before = not (Cl. is_simple cl.pci_expr) in
4102
- fmt_docstring_around_item_attrs ~force_before c cl.pci_attributes
4103
- in
4104
- let class_expr =
4105
- let pro =
4106
- box_fun_decl_args c 2
4107
- ( hovbox 2
4108
- ( str (if first then " class" else " and" )
4109
- $ fmt_if first (fmt_extension_suffix c ext)
4110
- $ fmt_attributes c ~pre: (Break (1 , 0 )) attrs_before
4111
- $ fmt_virtual_flag c cl.pci_virt
4112
- $ space_break
4113
- $ fmt_class_params c ctx cl.pci_params
4114
- $ fmt_str_loc c cl.pci_name )
4115
- $ fmt_if (not (List. is_empty xargs)) space_break
4116
- $ wrap_fun_decl_args c (fmt_class_fun_args c xargs) )
4117
- in
4118
- let intro =
4119
- match cl.pci_constraint with
4120
- | Some ty ->
4121
- fmt_class_type c
4122
- ~pro: (pro $ str " :" $ space_break)
4123
- (sub_cty ~ctx ty)
4124
- | None -> pro
4125
- in
4126
- hovbox 2
4127
- ( hovbox 2 (intro $ space_break $ str " =" )
4128
- $ space_break
4129
- $ fmt_class_expr c (sub_cl ~ctx cl.pci_expr) )
4130
- $ fmt_item_attributes c ~pre: (Break (1 , 0 )) attrs_after
4131
- in
4132
- fmt_if (not first) (str " \n " $ force_break)
4133
- $ hovbox 0
4134
- @@ Cmts. fmt c cl.pci_loc (doc_before $ class_expr $ doc_after) )
4094
+ update_config_maybe_disabled_attrs c cl.pci_loc cl.pci_attributes
4095
+ @@ fun c ->
4096
+ let ctx = Cd cl in
4097
+ let xargs = cl.pci_args in
4098
+ let ext = cl.pci_attributes.attrs_extension in
4099
+ let doc_before, doc_after, attrs_before, attrs_after =
4100
+ let force_before = not (Cl. is_simple cl.pci_expr) in
4101
+ fmt_docstring_around_item_attrs ~force_before c cl.pci_attributes
4102
+ in
4103
+ let class_expr =
4104
+ let pro =
4105
+ box_fun_decl_args c 2
4106
+ ( hovbox 2
4107
+ ( str (if first then " class" else " and" )
4108
+ $ fmt_if first (fmt_extension_suffix c ext)
4109
+ $ fmt_attributes c ~pre: (Break (1 , 0 )) attrs_before
4110
+ $ fmt_virtual_flag c cl.pci_virt
4111
+ $ space_break
4112
+ $ fmt_class_params c ctx cl.pci_params
4113
+ $ fmt_str_loc c cl.pci_name )
4114
+ $ fmt_if (not (List. is_empty xargs)) space_break
4115
+ $ wrap_fun_decl_args c (fmt_class_fun_args c xargs) )
4116
+ in
4117
+ let intro =
4118
+ match cl.pci_constraint with
4119
+ | Some ty ->
4120
+ fmt_class_type c
4121
+ ~pro: (pro $ str " :" $ space_break)
4122
+ (sub_cty ~ctx ty)
4123
+ | None -> pro
4124
+ in
4125
+ hovbox 2
4126
+ ( hovbox 2 (intro $ space_break $ str " =" )
4127
+ $ space_break
4128
+ $ fmt_class_expr c (sub_cl ~ctx cl.pci_expr) )
4129
+ $ fmt_item_attributes c ~pre: (Break (1 , 0 )) attrs_after
4130
+ in
4131
+ fmt_if (not first) (str " \n " $ force_break)
4132
+ $ hovbox 0
4133
+ @@ Cmts. fmt c cl.pci_loc (doc_before $ class_expr $ doc_after) )
4135
4134
4136
4135
and fmt_module c ctx ?rec_ ?epi ?(can_sparse = false ) keyword ?(eqty = " =" )
4137
4136
name xargs xbody xmty ~attrs ~rec_flag =
@@ -4229,13 +4228,13 @@ and fmt_module c ctx ?rec_ ?epi ?(can_sparse = false) keyword ?(eqty = "=")
4229
4228
$ fmt_item_attributes c ~pre: (Break (1 , 0 )) attrs_after
4230
4229
$ doc_after
4231
4230
$ opt epi (fun epi ->
4232
- fmt_or compact
4233
- (fmt_or
4234
- ( Option. is_some blk_b.epi
4235
- && not c.conf.fmt_opts.ocp_indent_compat.v )
4236
- (str " " ) space_break )
4237
- (break 1 (- 2 ))
4238
- $ epi ) )
4231
+ fmt_or compact
4232
+ (fmt_or
4233
+ ( Option. is_some blk_b.epi
4234
+ && not c.conf.fmt_opts.ocp_indent_compat.v )
4235
+ (str " " ) space_break )
4236
+ (break 1 (- 2 ))
4237
+ $ epi ) )
4239
4238
4240
4239
and fmt_module_declaration c ~rec_flag ~first {ast = pmd ; _} =
4241
4240
protect c (Md pmd)
0 commit comments