diff options
author | filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2000-11-24 16:13:28 +0000 |
---|---|---|
committer | filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2000-11-24 16:13:28 +0000 |
commit | 0c68df5ccdacb5d2ed50b533ad613723914dfee7 (patch) | |
tree | c83306fc05e7f70bdcd756086368e04b32e2699b /library/summary.ml | |
parent | 7f40f2807d4046a7cea8e83cb0a983cdc6401f78 (diff) |
certains effets disparaissent a la sortie des sections, d'autres non (selon Summary.survive_section)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@945 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'library/summary.ml')
-rw-r--r-- | library/summary.ml | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/library/summary.ml b/library/summary.ml index 0ba07a737..8fbd5efe4 100644 --- a/library/summary.ml +++ b/library/summary.ml @@ -8,7 +8,8 @@ open Names type 'a summary_declaration = { freeze_function : unit -> 'a; unfreeze_function : 'a -> unit; - init_function : unit -> unit } + init_function : unit -> unit; + survive_section : bool } let summaries = (Hashtbl.create 17 : (string, Dyn.t summary_declaration) Hashtbl.t) @@ -21,7 +22,8 @@ let declare_summary sumname sdecl = let ddecl = { freeze_function = dyn_freeze; unfreeze_function = dyn_unfreeze; - init_function = dyn_init} + init_function = dyn_init; + survive_section = sdecl.survive_section } in if Hashtbl.mem summaries sumname then anomalylabstrm "Summary.declare_summary" @@ -44,5 +46,14 @@ let unfreeze_summaries fs = with Not_found -> decl.init_function()) summaries +let unfreeze_lost_summaries fs = + Hashtbl.iter + (fun id decl -> + try + if not decl.survive_section 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 |