aboutsummaryrefslogtreecommitdiff
path: root/interp/notation.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2015-06-28 17:10:21 +0200
committerPierre-Marie Pédrot2015-06-28 17:10:21 +0200
commit6f982439294b9b53150c6c5d2fd1025e58d7bcd9 (patch)
treedebf9e53d93b722a871364e06763ddc8b0413bcf /interp/notation.ml
parent53dc6613499ca18672cda02697f182eb97cda8dc (diff)
parent02663c526a3fd347fad803eb664d22e6b5c088ad (diff)
Merge branch 'v8.5'
Diffstat (limited to 'interp/notation.ml')
-rw-r--r--interp/notation.ml13
1 files changed, 13 insertions, 0 deletions
diff --git a/interp/notation.ml b/interp/notation.ml
index 555dfa804b..0b5791d32b 100644
--- a/interp/notation.ml
+++ b/interp/notation.ml
@@ -200,6 +200,19 @@ let declare_delimiters scope key =
end
with Not_found -> delimiters_map := String.Map.add key scope !delimiters_map
+let remove_delimiters scope =
+ let sc = find_scope scope in
+ let newsc = { sc with delimiters = None } in
+ match sc.delimiters with
+ | None -> msg_warning (str "No bound key for scope " ++ str scope ++ str ".")
+ | Some key ->
+ scope_map := String.Map.add scope newsc !scope_map;
+ try
+ let _ = ignore (String.Map.find key !delimiters_map) in
+ delimiters_map := String.Map.remove key !delimiters_map
+ with Not_found ->
+ assert false (* A delimiter for scope [scope] should exist *)
+
let find_delimiters_scope loc key =
try String.Map.find key !delimiters_map
with Not_found ->