Skip to content

Commit 3c27b60

Browse files
committed
1 parent fadfd68 commit 3c27b60

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/coq_elpi_HOAS.ml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3700,9 +3700,8 @@ type module_item =
37003700

37013701
[%%if coq = "8.20" || coq = "9.0"]
37023702
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
37043704
let mod_type m = m.Declarations.mod_type
3705-
let mod_mp m = m.Declarations.mod_mp
37063705

37073706
let rec functor_params x =
37083707
let open Declarations in
@@ -3711,9 +3710,8 @@ let rec functor_params x =
37113710
| _ -> [] (* XXX non trivial functors, eg P : X with type a = nat, are badly described (no params) *)
37123711
[%%else]
37133712
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
37153714
let mod_type = Mod_declarations.mod_type
3716-
let mod_mp = Mod_declarations.mod_mp
37173715

37183716
let rec functor_params x =
37193717
let open Declarations in
@@ -3735,23 +3733,25 @@ let rec in_elpi_module_item ~depth path state (name, item) =
37353733
CList.init (Array.length mind_packets) (fun i -> Gref (GlobRef.IndRef (MutInd.make2 path name,i)))
37363734
| SFBrules _ -> nYI "rewrite rules"
37373735
| SFBmodule b ->
3736+
let mod_mp = MPdot (path, name) in
37383737
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)]
37413740
end
37423741
| SFBmodtype m ->
3742+
let mod_mp = MPdot (path, name) in
37433743
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)]
37463746
end
37473747

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 ->
37503750
match mod_type mb with
37513751
| Declarations.MoreFunctor _ -> nYI "functors"
37523752
| Declarations.NoFunctor contents ->
37533753
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
37553755
CList.flatten l
37563756

37573757
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 =
37703770
| Declarations.NoFunctor contents ->
37713771
CList.flatten (CList.map in_elpi_modty_item contents)
37723772

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
37743774

37753775
let in_elpi_module_type x = in_elpi_modty x
37763776

src/coq_elpi_HOAS.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ type module_item =
269269
| FunctorType of Names.ModPath.t * Names.ModPath.t list
270270

271271
[%%if coq = "8.20" || coq = "9.0"]
272-
val in_elpi_module : depth:int -> State.t -> Declarations.module_body -> module_item list
272+
val in_elpi_module : depth:int -> State.t -> ModPath.t -> Declarations.module_body -> module_item list
273273
val in_elpi_module_type : Declarations.module_type_body -> string list
274274
[%%else]
275-
val in_elpi_module : depth:int -> State.t -> Mod_declarations.module_body -> module_item list
275+
val in_elpi_module : depth:int -> State.t -> ModPath.t -> Mod_declarations.module_body -> module_item list
276276
val in_elpi_module_type : Mod_declarations.module_type_body -> string list
277277
[%%endif]
278278

src/coq_elpi_builtins.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ Supported attributes:
18461846
Out(list module_item, "Contents",
18471847
Read(global, "lists the contents of a module (recurses on submodules) *E*"))),
18481848
(fun mp _ ~depth {env} _ state ->
1849-
let t = in_elpi_module ~depth state (Environ.lookup_module mp env) in
1849+
let t = in_elpi_module ~depth state mp (Environ.lookup_module mp env) in
18501850
!: t)),
18511851
DocAbove);
18521852

0 commit comments

Comments
 (0)