From 97fefe1fcca363a1317e066e7f4b99b9c1e9987b Mon Sep 17 00:00:00 2001 From: Stephane Glondu Date: Thu, 12 Jan 2012 16:02:20 +0100 Subject: Imported Upstream version 8.4~beta --- library/nametab.ml | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) (limited to 'library/nametab.ml') diff --git a/library/nametab.ml b/library/nametab.ml index c4ea5953..6dbd927d 100644 --- a/library/nametab.ml +++ b/library/nametab.ml @@ -1,14 +1,13 @@ (************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) -(* (* This is an absolute name, we must keep it otherwise it may become unaccessible forever *) - Flags.if_verbose - warning ("Trying to mask the absolute name \"" - ^ U.to_string n ^ "\"!"); + Flags.if_warn + msg_warning (str ("Trying to mask the absolute name \"" + ^ U.to_string n ^ "\"!")); current | Nothing | Relative _ -> Relative (uname,o) @@ -132,7 +131,7 @@ struct become unaccessible forever *) (* But ours is also absolute! This is an error! *) error ("Cannot mask the absolute name \"" - ^ U.to_string uname' ^ "\"!") + ^ U.to_string uname' ^ "\"!") | Nothing | Relative _ -> Absolute (uname,o), dirmap @@ -149,9 +148,9 @@ let rec push_exactly uname o level (current,dirmap) = function | Absolute (n,_) -> (* This is an absolute name, we must keep it otherwise it may become unaccessible forever *) - Flags.if_verbose - warning ("Trying to mask the absolute name \"" - ^ U.to_string n ^ "\"!"); + Flags.if_warn + msg_warning (str ("Trying to mask the absolute name \"" + ^ U.to_string n ^ "\"!")); current | Nothing | Relative _ -> Relative (uname,o) @@ -288,10 +287,7 @@ let the_dirtab = ref (DirTab.empty : dirtab) (* Reversed name tables ***************************************************) (* This table translates extended_global_references back to section paths *) -module Globrevtab = Map.Make(struct - type t=extended_global_reference - let compare = compare - end) +module Globrevtab = Map.Make(ExtRefOrdered) type globrevtab = full_path Globrevtab.t let the_globrevtab = ref (Globrevtab.empty : globrevtab) @@ -379,7 +375,6 @@ let locate_modtype qid = SpTab.locate qid !the_modtypetab let full_name_modtype qid = SpTab.user_name qid !the_modtypetab let locate_tactic qid = SpTab.locate qid !the_tactictab -let full_name_tactic qid = SpTab.user_name qid !the_tactictab let locate_dir qid = DirTab.locate qid !the_dirtab @@ -412,11 +407,6 @@ let locate_constant qid = | TrueGlobal (ConstRef kn) -> kn | _ -> raise Not_found -let locate_mind qid = - match locate_extended qid with - | TrueGlobal (IndRef (kn,0)) -> kn - | _ -> raise Not_found - let global_of_path sp = match SpTab.find sp !the_ccitab with | TrueGlobal ref -> ref @@ -424,9 +414,6 @@ let global_of_path sp = let extended_global_of_path sp = SpTab.find sp !the_ccitab -let locate_in_absolute_module dir id = - global_of_path (make_path dir id) - let global r = let (loc,qid) = qualid_of_reference r in try match locate_extended qid with @@ -450,8 +437,6 @@ let exists_module = exists_dir let exists_modtype sp = SpTab.exists sp !the_modtypetab -let exists_tactic sp = SpTab.exists sp !the_tactictab - (* Reverse locate functions ***********************************************) let path_of_global ref = -- cgit v1.2.3