diff options
author | 2013-05-12 15:54:13 +0000 | |
---|---|---|
committer | 2013-05-12 15:54:13 +0000 | |
commit | ffb47b4d67608653c1ae024c5b291db8b209dddb (patch) | |
tree | fb1dcc90aba64e5d397c5d9d7e0c7c0b22e96d9c /plugins/extraction/common.ml | |
parent | de26e97cf37cafd37b83377d2df062a6e82676e7 (diff) |
Removing Gmap from Extraction plugin
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16511 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'plugins/extraction/common.ml')
-rw-r--r-- | plugins/extraction/common.ml | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/plugins/extraction/common.ml b/plugins/extraction/common.ml index 86ea93294..dbd280a1e 100644 --- a/plugins/extraction/common.ml +++ b/plugins/extraction/common.ml @@ -280,14 +280,24 @@ let add_visible ks l = Hashtbl.add (top_visible ()).content ks l (* table of local module wrappers used to provide non-ambiguous names *) +module DupOrd = +struct + type t = ModPath.t * Label.t + let compare (mp1, l1) (mp2, l2) = + let c = Label.compare l1 l2 in + if c = 0 then ModPath.compare mp1 mp2 else c +end + +module DupMap = Map.Make(DupOrd) + let add_duplicate, check_duplicate = - let index = ref 0 and dups = ref Gmap.empty in - register_cleanup (fun () -> index := 0; dups := Gmap.empty); + let index = ref 0 and dups = ref DupMap.empty in + register_cleanup (fun () -> index := 0; dups := DupMap.empty); let add mp l = incr index; - let ren = "Coq__" ^ string_of_int (!index) in - dups := Gmap.add (mp,l) ren !dups - and check mp l = Gmap.find (mp, l) !dups + let ren = "Coq__" ^ string_of_int !index in + dups := DupMap.add (mp,l) ren !dups + and check mp l = DupMap.find (mp, l) !dups in (add,check) type reset_kind = AllButExternal | Everything |