@@ -196,6 +196,16 @@ let realizer_command ~opaque_access arity name var real =
196196let 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+
199209let 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