1- open Asttypes
2- open Parsetree
1+ open Migrate_parsetree.Ast_404. Asttypes
2+ open Migrate_parsetree.Ast_404. Parsetree
33
44let rec li_eq li1 li2 =
55 let open Longident in
@@ -39,7 +39,7 @@ and expr_list_eq el1 el2 =
3939 with Invalid_argument _ -> false
4040
4141and label_eq l1 l2 =
42- let open Ast_convenience.Label in
42+ let open Ppx_tools_404. Ast_convenience.Label in
4343 match explode l1, explode l2 with
4444 | Nolabel , Nolabel -> true
4545 | Labelled s1, Labelled s2
@@ -54,4 +54,18 @@ and expr_label_list_eq el1 el2 =
5454 List. for_all2 expr_label_eq el1 el2
5555 with Invalid_argument _ -> false
5656
57- let sigitem_attributes = Compat. sigitem_attributes
57+ let sigitem_attributes { psig_desc } =
58+ match psig_desc with
59+ | Psig_value vd -> [vd.pval_attributes]
60+ | Psig_type (_ , tdecls ) -> List. map (fun tdecl -> tdecl.ptype_attributes) tdecls
61+ | Psig_typext text -> [text.ptyext_attributes]
62+ | Psig_exception exc -> [exc.pext_attributes]
63+ | Psig_module md -> [md.pmd_attributes]
64+ | Psig_recmodule mds -> List. map (fun md -> md.pmd_attributes) mds
65+ | Psig_modtype pmtd -> [pmtd.pmtd_attributes]
66+ | Psig_open popen -> [popen.popen_attributes]
67+ | Psig_include pincl -> [pincl.pincl_attributes]
68+ | Psig_class pcis
69+ | Psig_class_type pcis -> List. map (fun pct -> pct.pci_attributes) pcis
70+ | Psig_attribute attribute -> [[attribute]]
71+ | Psig_extension (_ , attributes ) -> [attributes]
0 commit comments