diff options
author | coq <coq@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2002-08-02 17:17:42 +0000 |
---|---|---|
committer | coq <coq@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2002-08-02 17:17:42 +0000 |
commit | 12965209478bd99dfbe57f07d5b525e51b903f22 (patch) | |
tree | 36a7f5e4802cd321caf02fed0be8349100be09fb /library/summary.ml | |
parent | 8b26fd6ba739d4f49fae99ed764b086022e44b50 (diff) |
Modules dans COQ\!\!\!\!
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@2957 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'library/summary.ml')
-rw-r--r-- | library/summary.ml | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/library/summary.ml b/library/summary.ml index 210a1a81b..59560af22 100644 --- a/library/summary.ml +++ b/library/summary.ml @@ -10,7 +10,6 @@ open Pp open Util -open Names type 'a summary_declaration = { freeze_function : unit -> 'a; @@ -21,8 +20,8 @@ type 'a summary_declaration = { let summaries = (Hashtbl.create 17 : (string, Dyn.t summary_declaration) Hashtbl.t) -let declare_summary sumname sdecl = - let (infun,outfun) = Dyn.create (sumname^"-SUMMARY") in +let internal_declare_summary sumname sdecl = + let (infun,outfun) = Dyn.create sumname in let dyn_freeze () = infun (sdecl.freeze_function()) and dyn_unfreeze sum = sdecl.unfreeze_function (outfun sum) and dyn_init = sdecl.init_function in @@ -37,6 +36,14 @@ let declare_summary sumname sdecl = (str "Cannot declare a summary twice: " ++ str sumname); Hashtbl.add summaries sumname ddecl +let declare_summary sumname decl = + internal_declare_summary (sumname^"-SUMMARY") decl + +let envsummary = "Global environment SUMMARY" + +let declare_global_environment sdecl = + internal_declare_summary envsummary sdecl + type frozen = Dyn.t Stringmap.t let freeze_summaries () = @@ -62,5 +69,14 @@ let unfreeze_lost_summaries fs = with Not_found -> decl.init_function()) summaries +let unfreeze_other_summaries fs = + Hashtbl.iter + (fun id decl -> + try + if id <> envsummary then + decl.unfreeze_function (Stringmap.find id fs) + with Not_found -> decl.init_function()) + summaries + let init_summaries () = Hashtbl.iter (fun _ decl -> decl.init_function()) summaries |