aboutsummaryrefslogtreecommitdiff
path: root/interp
diff options
context:
space:
mode:
Diffstat (limited to 'interp')
-rw-r--r--interp/symbols.ml11
-rw-r--r--interp/symbols.mli3
2 files changed, 14 insertions, 0 deletions
diff --git a/interp/symbols.ml b/interp/symbols.ml
index 0c988f315c..ef2cf6b0b8 100644
--- a/interp/symbols.ml
+++ b/interp/symbols.ml
@@ -396,6 +396,17 @@ let locate_notation prraw ntn =
fnl ()))
l
+let find_notation_level ntn =
+ let l =
+ Stringmap.fold
+ (fun _ sc l ->
+ try fst (snd (Stringmap.find ntn sc.notations)) :: l
+ with Not_found -> l) !scope_map [] in
+ match l with
+ | [] -> raise Not_found
+ | [prec] -> prec
+ | prec::_ -> warning ("Several parsing rules for notation \""^ntn^"\""); prec
+
(**********************************************************************)
(* Mapping notations to concrete syntax *)
diff --git a/interp/symbols.mli b/interp/symbols.mli
index 42eedaf81c..fa3d778f1b 100644
--- a/interp/symbols.mli
+++ b/interp/symbols.mli
@@ -117,6 +117,9 @@ val pr_scope : (rawconstr -> std_ppcmds) -> scope_name -> std_ppcmds
val pr_scopes : (rawconstr -> std_ppcmds) -> std_ppcmds
val locate_notation : (rawconstr -> std_ppcmds) -> notation -> std_ppcmds
+(* [raise Not_found] if non existing notation *)
+val find_notation_level : notation -> level
+
(**********************************************************************)
(*s Printing rules for notations *)