Skip to content

Commit 35c19a8

Browse files
authored
Merge pull request #666 from SkySkimmer/discharge-export
Adapt to rocq-prover/rocq#19361 (Lib.*.close_section is incomplete, use Declaremods instead)
2 parents 48c3020 + a40a027 commit 35c19a8

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/coq_elpi_builtins_synterp.ml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,12 @@ module SynterpAction = struct
561561

562562
type 'a replay = 'a -> State.t -> State.t * ModPath.t option
563563

564+
[%%if coq = "8.19" || coq = "8.20"]
565+
let interp_close_section = Lib.Interp.close_section
566+
[%%else]
567+
let interp_close_section = Declaremods.Interp.close_section
568+
[%%endif]
569+
564570
let replay1 action state =
565571
match action with
566572
| BeginModule((name,_,_),binders_ast,ty) ->
@@ -597,7 +603,7 @@ module SynterpAction = struct
597603
let loc = to_coq_loc @@ State.get invocation_site_loc state in
598604
Dumpglob.dump_reference ~loc
599605
(DirPath.to_string (Lib.current_dirpath true)) "<>" "sec";
600-
Lib.Interp.close_section ();
606+
interp_close_section ();
601607
(Coq_elpi_HOAS.grab_global_env_drop_sigma state, None)
602608
| ImportModule mp ->
603609
Declaremods.import_module ~export:Lib.Import Libobject.unfiltered mp;
@@ -926,6 +932,12 @@ let attribute_value = let open API.AlgebraicData in let open CConv in declare {
926932

927933
let attribute = attribute attribute_value
928934

935+
[%%if coq = "8.19" || coq = "8.20"]
936+
let synterp_close_section = Lib.Synterp.close_section
937+
[%%else]
938+
let synterp_close_section = Declaremods.Synterp.close_section
939+
[%%endif]
940+
929941
let coq_synterp_builtins =
930942
let open API.BuiltIn in
931943
let open Pred in
@@ -1149,7 +1161,7 @@ coq.env.begin-module-type Name :-
11491161
MLCode(Pred("coq.env.end-section",
11501162
Full(unit_ctx, "end the current section *E*"),
11511163
(fun ~depth _ _ state ->
1152-
Lib.Synterp.close_section ();
1164+
synterp_close_section ();
11531165
let state = SynterpAction.(push EndSection) state in
11541166
state, (), [])),
11551167
DocAbove);

0 commit comments

Comments
 (0)