aboutsummaryrefslogtreecommitdiff
path: root/interp/notation.ml
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2016-09-24 20:36:59 +0200
committerEmilio Jesus Gallego Arias2016-09-25 21:59:57 +0200
commit0f1b5603d1922718f36545f201212fc2796f41a4 (patch)
tree6385e1500feee1bf5564c0802763df6f0f4505e4 /interp/notation.ml
parentf487472a5628fdb43245e782b304705172a1f569 (diff)
[notation] Allow to retrieve defined notations.
The ML side lacks a method to query Coq for notations with defined parsing/printing rules. This commit adds a method `get_defined_notations` to that purpose. This is very useful for instance in plugins like SerAPI. In the medium-term, the `Notation` interface may benefit from a bit of refactoring to allow programmatic access and manipulation of notations.
Diffstat (limited to 'interp/notation.ml')
-rw-r--r--interp/notation.ml3
1 files changed, 3 insertions, 0 deletions
diff --git a/interp/notation.ml b/interp/notation.ml
index 0798d385d4..547c72e107 100644
--- a/interp/notation.ml
+++ b/interp/notation.ml
@@ -1011,6 +1011,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 :=