@@ -3700,9 +3700,8 @@ type module_item =
3700
3700
3701
3701
[%% if coq = " 8.20" || coq = " 9.0" ]
3702
3702
type 'a generic_module_body = 'a Declarations .generic_module_body
3703
- let module_view m = ( m.Declarations. mod_mp, m. Declarations. mod_type)
3703
+ let module_view m = m.Declarations. mod_type
3704
3704
let mod_type m = m.Declarations. mod_type
3705
- let mod_mp m = m.Declarations. mod_mp
3706
3705
3707
3706
let rec functor_params x =
3708
3707
let open Declarations in
@@ -3711,9 +3710,8 @@ let rec functor_params x =
3711
3710
| _ -> [] (* XXX non trivial functors, eg P : X with type a = nat, are badly described (no params) *)
3712
3711
[%% else ]
3713
3712
type 'a generic_module_body = 'a Mod_declarations .generic_module_body
3714
- let module_view m = ( Mod_declarations. mod_mp m, Mod_declarations. mod_type m)
3713
+ let module_view m = Mod_declarations. mod_type m
3715
3714
let mod_type = Mod_declarations. mod_type
3716
- let mod_mp = Mod_declarations. mod_mp
3717
3715
3718
3716
let rec functor_params x =
3719
3717
let open Declarations in
@@ -3735,23 +3733,25 @@ let rec in_elpi_module_item ~depth path state (name, item) =
3735
3733
CList. init (Array. length mind_packets) (fun i -> Gref (GlobRef. IndRef (MutInd. make2 path name,i)))
3736
3734
| SFBrules _ -> nYI " rewrite rules"
3737
3735
| SFBmodule b ->
3736
+ let mod_mp = MPdot (path, name) in
3738
3737
begin match module_view b with
3739
- | mod_mp , NoFunctor _ -> [Module (mod_mp,in_elpi_module ~depth state b) ]
3740
- | mod_mp , (MoreFunctor _ as l ) -> [Functor (mod_mp,functor_params l)]
3738
+ | NoFunctor _ -> [Module (mod_mp,in_elpi_module ~depth state mod_mp b) ]
3739
+ | (MoreFunctor _ as l ) -> [Functor (mod_mp,functor_params l)]
3741
3740
end
3742
3741
| SFBmodtype m ->
3742
+ let mod_mp = MPdot (path, name) in
3743
3743
begin match module_view m with
3744
- | mod_mp , NoFunctor _ -> [ModuleType mod_mp]
3745
- | mod_mp , (MoreFunctor _ as l ) -> [FunctorType (mod_mp,functor_params l)]
3744
+ | NoFunctor _ -> [ModuleType mod_mp]
3745
+ | (MoreFunctor _ as l ) -> [FunctorType (mod_mp,functor_params l)]
3746
3746
end
3747
3747
3748
- and in_elpi_module : 'a. depth:int -> API.Data.state -> 'a generic_module_body -> module_item list =
3749
- fun ~depth state mb ->
3748
+ and in_elpi_module : 'a. depth:int -> API.Data.state -> ModPath.t -> 'a generic_module_body -> module_item list =
3749
+ fun ~depth state mp mb ->
3750
3750
match mod_type mb with
3751
3751
| Declarations. MoreFunctor _ -> nYI " functors"
3752
3752
| Declarations. NoFunctor contents ->
3753
3753
let l =
3754
- CList. map (in_elpi_module_item ~depth (mod_mp mb) state) contents in
3754
+ CList. map (in_elpi_module_item ~depth mp state) contents in
3755
3755
CList. flatten l
3756
3756
3757
3757
let rec in_elpi_modty_item (name , item ) = match item with
@@ -3770,7 +3770,7 @@ and in_elpi_modty : 'a.'a generic_module_body -> string list =
3770
3770
| Declarations. NoFunctor contents ->
3771
3771
CList. flatten (CList. map in_elpi_modty_item contents)
3772
3772
3773
- let in_elpi_module ~depth s x = in_elpi_module ~depth s x
3773
+ let in_elpi_module ~depth s mp x = in_elpi_module ~depth s mp x
3774
3774
3775
3775
let in_elpi_module_type x = in_elpi_modty x
3776
3776
0 commit comments