aboutsummaryrefslogtreecommitdiff
path: root/interp/reserve.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2013-12-22 01:02:21 +0100
committerPierre-Marie Pédrot2013-12-22 04:41:57 +0100
commitca67a3fb4184c81449101d9a0cec511ccde09d43 (patch)
treeb778b4942fbe2558be3d8707d4578d2a0d79540c /interp/reserve.ml
parent66e426a93fc00682128a0441d6dda3425e0be252 (diff)
Notations can now accept dummy arguments. If ever a bound variable is not
used, they are automatically flagged as only parsing. CAVEAT: unused arguments are not typechecked, because they are dropped before the interpretation phase.
Diffstat (limited to 'interp/reserve.ml')
-rw-r--r--interp/reserve.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/interp/reserve.ml b/interp/reserve.ml
index 77ca9e2673..4328be7d86 100644
--- a/interp/reserve.ml
+++ b/interp/reserve.ml
@@ -107,12 +107,18 @@ let _ = Namegen.set_reserved_typed_name revert_reserved_type
open Glob_term
+let default_env () = {
+ ninterp_var_type = Id.Map.empty;
+ ninterp_rec_vars = Id.Map.empty;
+ ninterp_only_parse = false;
+}
+
let anonymize_if_reserved na t = match na with
| Name id as na ->
(try
if not !Flags.raw_print &&
(try
- let ntn = notation_constr_of_glob_constr Id.Map.empty Id.Map.empty t in
+ let ntn = notation_constr_of_glob_constr (default_env ()) t in
Pervasives.(=) ntn (find_reserved_type id) (** FIXME *)
with UserError _ -> false)
then GHole (Loc.ghost,Evar_kinds.BinderType na,None)