aboutsummaryrefslogtreecommitdiffhomepage
path: root/interp
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2016-10-12 21:48:27 +0200
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2016-10-12 21:48:27 +0200
commitd873f82c5024a496e8f1a14a9839e7f377d5f4bb (patch)
tree1d71b3aff46f14a65f2d7675468ce47d7965a2c0 /interp
parent0222f685ebdd55a1596d6689b96ebb86454ba1a7 (diff)
parent0f1b5603d1922718f36545f201212fc2796f41a4 (diff)
Merge PR #289 into v8.6.
Diffstat (limited to 'interp')
-rw-r--r--interp/notation.ml3
-rw-r--r--interp/notation.mli3
2 files changed, 6 insertions, 0 deletions
diff --git a/interp/notation.ml b/interp/notation.ml
index d301ed21d..389a1c9df 100644
--- a/interp/notation.ml
+++ b/interp/notation.ml
@@ -1009,6 +1009,9 @@ let find_notation_parsing_rules ntn =
try pi3 (String.Map.find ntn !notation_rules)
with Not_found -> anomaly (str "No parsing rule found for " ++ str ntn)
+let get_defined_notations () =
+ String.Set.elements @@ String.Map.domain !notation_rules
+
let add_notation_extra_printing_rule ntn k v =
try
notation_rules :=
diff --git a/interp/notation.mli b/interp/notation.mli
index b47e1975e..2e92a00a8 100644
--- a/interp/notation.mli
+++ b/interp/notation.mli
@@ -203,6 +203,9 @@ val find_notation_extra_printing_rules : notation -> extra_unparsing_rules
val find_notation_parsing_rules : notation -> notation_grammar
val add_notation_extra_printing_rule : notation -> string -> string -> unit
+(** Returns notations with defined parsing/printing rules *)
+val get_defined_notations : unit -> notation list
+
(** Rem: printing rules for primitive token are canonical *)
val with_notation_protection : ('a -> 'b) -> 'a -> 'b