diff options
| author | gareuselesinge | 2013-03-08 13:55:12 +0000 |
|---|---|---|
| committer | gareuselesinge | 2013-03-08 13:55:12 +0000 |
| commit | 9d0fde51068c1f1c16142865457a43d2fd5143ee (patch) | |
| tree | e47bc32d2c10d7c34b65631a1a193901eef10870 | |
| parent | 82b65b9c0296b20cca44c7c05865bf9750084ab8 (diff) | |
Use with_state_protection in pr_module_vardecls
This makes pr_module_vardecls side effect free, as any pp function should be
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16261 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | printing/ppvernac.ml | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/printing/ppvernac.ml b/printing/ppvernac.ml index d2f5beedfd..4a91e12849 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 |
