aboutsummaryrefslogtreecommitdiffhomepage
path: root/interp/syntax_def.ml
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2009-08-06 19:00:11 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2009-08-06 19:00:11 +0000
commitffa57bae1e18fd52d63e8512a352ac63db15a7a9 (patch)
tree6cf537ce557f14f71ee3693d98dc20c12b64a9e4 /interp/syntax_def.ml
parentda7fb3e13166747b49cdf1ecfad394ecb4e0404a (diff)
- Cleaning phase of the interfaces of libnames.ml and nametab.ml
(uniformisation of function names, classification). One of the most visible change is the renaming of section_path into full_path (the use of name section was obsolete due to the module system, but I don't know if the new name is the best chosen one - especially it remains some "sp" here and there). - Simplification of the interface of classify_object (first argument dropped). - Simplification of the code for vernac keyword "End". - Other small cleaning or dead code removal. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12265 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'interp/syntax_def.ml')
-rw-r--r--interp/syntax_def.ml13
1 files changed, 7 insertions, 6 deletions
diff --git a/interp/syntax_def.ml b/interp/syntax_def.ml
index bb8d68323..ef5ecf62a 100644
--- a/interp/syntax_def.ml
+++ b/interp/syntax_def.ml
@@ -16,6 +16,7 @@ open Topconstr
open Libobject
open Lib
open Nameops
+open Nametab
(* Syntactic definitions. *)
@@ -37,13 +38,13 @@ let load_syntax_constant i ((sp,kn),(local,pat,onlyparse)) =
errorlabstrm "cache_syntax_constant"
(pr_id (basename sp) ++ str " already exists");
add_syntax_constant kn pat;
- Nametab.push_syntactic_definition (Nametab.Until i) sp kn;
+ Nametab.push_syndef (Nametab.Until i) sp kn;
if not onlyparse then
(* Declare it to be used as long name *)
Notation.declare_uninterpretation (Notation.SynDefRule kn) pat
let open_syntax_constant i ((sp,kn),(_,pat,onlyparse)) =
- Nametab.push_syntactic_definition (Nametab.Exactly i) sp kn;
+ Nametab.push_syndef (Nametab.Exactly i) sp kn;
if not onlyparse then
(* Redeclare it to be used as (short) name in case an other (distfix)
notation was declared inbetween *)
@@ -55,7 +56,7 @@ let cache_syntax_constant d =
let subst_syntax_constant ((sp,kn),subst,(local,pat,onlyparse)) =
(local,subst_interpretation subst pat,onlyparse)
-let classify_syntax_constant (_,(local,_,_ as o)) =
+let classify_syntax_constant (local,_,_ as o) =
if local then Dispose else Substitute o
let export_syntax_constant (local,_,_ as o) =
@@ -85,19 +86,19 @@ let search_syntactic_definition loc kn =
let global_of_extended_global = function
| TrueGlobal ref -> ref
- | SyntacticDef kn ->
+ | SynDef kn ->
match search_syntactic_definition dummy_loc kn with
| [],ARef ref -> ref
| _ -> raise Not_found
let locate_global_with_alias (loc,qid) =
- let ref = Nametab.extended_locate qid in
+ let ref = Nametab.locate_extended qid in
try global_of_extended_global ref
with Not_found ->
user_err_loc (loc,"",pr_qualid qid ++
str " is bound to a notation that does not denote a reference")
-let inductive_of_reference_with_alias r =
+let global_inductive_with_alias r =
match locate_global_with_alias (qualid_of_reference r) with
| IndRef ind -> ind
| ref ->