123456789101112131415161718192021222324252627282930openBaseopenPpxlibopenPrintfletname="distrib"let()=Ppxlib.Driver.register_transformation~impl:(funss->letopenPpx_distrib_expanderinletm=object(self)inheritAst_traverse.mapassupermethod!structuress=(* TODO: Maybe we don't need this *)List.concat@@List.map~f:(self#do_structure_item)ssmethoddo_structure_itemsi=matchsi.pstr_descwith|Pstr_type(flg,tydecls)->List.concat@@List.maptydecls~f:(funtydecl->ifsuitable_tydecltydeclthenstr_type_decl~loc:si.pstr_loc(flg,tydecls)else[{siwithpstr_desc=Pstr_type(flg,List.map~f:(super#type_declaration)tydecls)}])|_->[super#structure_itemsi]endinm#structuress)name