File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -937,11 +937,15 @@ let rec update_path config block stream tok =
937937 (* Two ways to detect let vs letin ;
938938 both seem to work, but need to check which one
939939 is the most robust (for example w.r.t. unfinished expressions) *)
940- (* - it's a top Let if it is after a closed expression *)
940+ (* it's a top Let if it is:
941+ - after a closed expression
942+ - inside a [struct]
943+ - after [type = |]
944+ *)
941945 (match block.path with
942946 | {kind =KExpr i } ::p when i = prio_max ->
943947 append KLet L (unwind_top p)
944- | [] | {kind =KCodeInComment } :: _ | { kind = KBar KType } ::_ as p ->
948+ | [] | {kind =KCodeInComment | KBar KType | KStruct } ::_ as p ->
945949 append KLet L (unwind_top p)
946950 | _ ->
947951 append KLetIn L (fold_expr block.path))
Original file line number Diff line number Diff line change 6060 > with type t1 = t1'
6161 > and type t2 = t2')
6262 >
63+ > (* Detection of [Let] vs [LetIn] inside a [struct]. * )
64+ > module M = struct
65+ > let indentation_after_fun =
66+ > fun foo ->
67+ > bar
68+ > end
69+ >
70+ > (* Unfinished [struct] * )
6371 > module Store (K: API. KEY) (V: API. VALUE) :
6472 > API. STORE with module K = K
6573 > and module V = V =
129137 with type t1 = t1'
130138 and type t2 = t2')
131139
140+ (* Detection of [Let] vs [LetIn] inside a [struct]. * )
141+ module M = struct
142+ let indentation_after_fun =
143+ fun foo ->
144+ bar
145+ end
146+
147+ (* Unfinished [struct] * )
132148 module Store (K: API. KEY) (V: API. VALUE) :
133149 API. STORE with module K = K
134150 and module V = V =
You can’t perform that action at this time.
0 commit comments