aboutsummaryrefslogtreecommitdiff
path: root/interp/syntax_def.ml
diff options
context:
space:
mode:
authorherbelin2005-05-20 15:45:51 +0000
committerherbelin2005-05-20 15:45:51 +0000
commitf95411d169c8d636e980de3a38bb02c72c3b4965 (patch)
tree8d51764141dc5ff922f4cdbb0812a954ca7fa725 /interp/syntax_def.ml
parent72e2acbcf23a70b9d6a708676b0053a7cd4eca0b (diff)
Déplacement et export de locate_global (ex-locate_reference) de tacinterp vers syntax_def
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@7051 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'interp/syntax_def.ml')
-rw-r--r--interp/syntax_def.ml12
1 files changed, 12 insertions, 0 deletions
diff --git a/interp/syntax_def.ml b/interp/syntax_def.ml
index 17c0e96c89..25dc54b370 100644
--- a/interp/syntax_def.ml
+++ b/interp/syntax_def.ml
@@ -73,3 +73,15 @@ let rec set_loc loc _ a =
let search_syntactic_definition loc kn =
set_loc loc () (KNmap.find kn !syntax_table)
+
+exception BoundToASyntacticDefThatIsNotARef
+
+let locate_global qid =
+ match Nametab.extended_locate qid with
+ | TrueGlobal ref -> ref
+ | SyntacticDef kn ->
+ match search_syntactic_definition dummy_loc kn with
+ | Rawterm.RRef (_,ref) -> ref
+ | _ ->
+ errorlabstrm "" (pr_qualid qid ++
+ str " is bound to a notation that does not denote a reference")