aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--printing/ppvernac.ml19
1 files changed, 10 insertions, 9 deletions
diff --git a/printing/ppvernac.ml b/printing/ppvernac.ml
index d2f5beedf..4a91e1284 100644
--- a/printing/ppvernac.ml
+++ b/printing/ppvernac.ml
@@ -257,15 +257,16 @@ let pr_require_token = function
let pr_module_vardecls pr_c (export,idl,(mty,inl)) =
let m = pr_module_ast pr_c mty in
(* Update the Nametab for interpreting the body of module/modtype *)
- let lib_dir = Lib.library_dp() in
- List.iter (fun (_,id) ->
- Declaremods.process_module_bindings [id]
- [MBId.make lib_dir id,
- (Modintern.interp_modtype (Global.env()) mty, inl)]) idl;
- (* Builds the stream *)
- spc() ++
- hov 1 (str"(" ++ pr_require_token export ++
- prlist_with_sep spc pr_lident idl ++ str":" ++ m ++ str")")
+ States.with_state_protection (fun () ->
+ let lib_dir = Lib.library_dp() in
+ List.iter (fun (_,id) ->
+ Declaremods.process_module_bindings [id]
+ [MBId.make lib_dir id,
+ (Modintern.interp_modtype (Global.env()) mty, inl)]) idl;
+ (* Builds the stream *)
+ spc() ++
+ hov 1 (str"(" ++ pr_require_token export ++
+ prlist_with_sep spc pr_lident idl ++ str":" ++ m ++ str")")) ()
let pr_module_binders l pr_c =
(* Effet de bord complexe pour garantir la declaration des noms des