diff options
| author | Hugo Herbelin | 2016-09-01 11:16:09 +0200 |
|---|---|---|
| committer | Hugo Herbelin | 2016-09-01 11:18:27 +0200 |
| commit | 5776f7d2b4753b89efa095a0f6774dac702fdfbd (patch) | |
| tree | 9108d9b350d4f4746701a4df3ac9ef5e8ca5cb37 /interp/notation_ops.ml | |
| parent | 04f3aea9afa9fc4b7fa5a50be21b992ba9018dbc (diff) | |
Notation_ops.subst_glob_vars: substituting also in evar kind for
consistency of the use of names.
Diffstat (limited to 'interp/notation_ops.ml')
| -rw-r--r-- | interp/notation_ops.ml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/interp/notation_ops.ml b/interp/notation_ops.ml index de56dbe0ab..fcb4a345e2 100644 --- a/interp/notation_ops.ml +++ b/interp/notation_ops.ml @@ -124,6 +124,14 @@ let rec cases_pattern_fold_map loc g e = function let e',patl' = List.fold_map (cases_pattern_fold_map loc g) e patl in e', PatCstr (loc,cstr,patl',na') +let subst_binder_type_vars l = function + | Evar_kinds.BinderType (Name id) as e -> + let id = + try match Id.List.assoc id l with GVar(_,id') -> id' | _ -> id + with Not_found -> id in + Evar_kinds.BinderType (Name id) + | e -> e + let rec subst_glob_vars l = function | GVar (_,id) as r -> (try Id.List.assoc id l with Not_found -> r) | GProd (loc,Name id,bk,t,c) -> @@ -136,6 +144,7 @@ let rec subst_glob_vars l = function try match Id.List.assoc id l with GVar(_,id') -> id' | _ -> id with Not_found -> id in GLambda (loc,Name id,bk,subst_glob_vars l t,subst_glob_vars l c) + | GHole (loc,x,naming,arg) -> GHole (loc,subst_binder_type_vars l x,naming,arg) | r -> map_glob_constr (subst_glob_vars l) r (* assume: id is not binding *) let ldots_var = Id.of_string ".." |
