File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 2424 ]}
2525 on module (Pstr_module),
2626 toplevel bindings (Pstr_value, Pstr_primitive)
27- and pattern in case (pc_lhs)
27+ pattern in case (pc_lhs)
28+ and module in signature (Psig_module)
2829*)
2930
3031open StdLabels
@@ -296,7 +297,21 @@ let traverse =
296297 | Some pattern -> Some { case with pc_lhs = pattern })
297298 in
298299 super#cases cases
300+
301+ method! signature_item item =
302+ match item.psig_desc with
303+ | Psig_module { pmd_attributes; pmd_loc; _ } ->
304+ if keep pmd_loc pmd_attributes
305+ then item
306+ else
307+ let open Ppxlib.Ast_builder.Default in
308+ let loc = Location. none in
309+ psig_include ~loc (include_infos ~loc (pmty_signature ~loc [] ))
310+ | _ -> item
299311 end
300312
301313let () =
302- Ppxlib.Driver. register_transformation ~impl: traverse#structure " ppx_optcomp_light"
314+ Ppxlib.Driver. register_transformation
315+ ~impl: traverse#structure
316+ ~intf: traverse#signature
317+ " ppx_optcomp_light"
You can’t perform that action at this time.
0 commit comments