Skip to content

Commit 09e36c4

Browse files
authored
Merge pull request #145 from SkySkimmer/declmods-compat
Adapt to rocq-prover/rocq#21365 (hack around phase separation)
2 parents 691153e + bba6fc0 commit 09e36c4

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/declare_translation.ml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,16 @@ let realizer_command ~opaque_access arity name var real =
196196
let rec list_continuation final f l _ = match l with [] -> final ()
197197
| hd::tl -> f (list_continuation final f tl) hd
198198

199+
(* HACK does not respect synterp phase!!! *)
200+
let start_module export id args res =
201+
let mp, args, sign = Declaremods.Synterp.start_module export id args res in
202+
Declaremods.Interp.start_module export id args sign
203+
204+
(* HACK!!! *)
205+
let end_module () =
206+
let _mp = Declaremods.Synterp.end_module () in
207+
Declaremods.Interp.end_module ()
208+
199209
let rec translate_module_command ~opaque_access ?name arity r =
200210
check_nothing_ongoing ();
201211
let qid = r in
@@ -226,11 +236,11 @@ and declare_module ~opaque_access ?(continuation = ignore) ?name arity mp mb =
226236
let id_R = match name with Some id -> id | None -> translate_id arity id in
227237
debug_string [`Module] (Printf.sprintf "start module: '%s' (translating '%s')."
228238
(Names.Id.to_string id_R) (Names.Id.to_string id));
229-
let _mp_R = Declaremods.start_module None id_R [] (Declaremods.Check []) in
239+
let _mp_R = start_module None id_R [] (Declaremods.Check []) in
230240
list_continuation
231241
(fun _ ->
232242
debug_string [`Module] (Printf.sprintf "end module: '%s'." (Names.Id.to_string id_R));
233-
ignore (Declaremods.end_module ()); continuation ())
243+
ignore (end_module ()); continuation ())
234244
(fun continuation -> function
235245
| (lab, SFBconst cb) when (match cb.const_body with OpaqueDef _ -> false | Undef _ -> true | _ -> false) ->
236246
let cst = Mod_subst.constant_of_delta_kn (Mod_declarations.mod_delta mb) (Names.KerName.make mp lab) in

0 commit comments

Comments
 (0)