aboutsummaryrefslogtreecommitdiffhomepage
path: root/interp
diff options
context:
space:
mode:
authorGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2018-04-09 16:08:48 +0200
committerGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2018-04-09 16:08:48 +0200
commit834530272b9006e28a4b7ba35b1f8f861f51e7ce (patch)
treee485fd87323492daf135d7eecbb330a9e03fc0bb /interp
parentf9ef634e94c667641a9da12fa2b9f8e585d6d5c6 (diff)
parent8ad6bf357284f3fcfd94f08561450bb5bf38ad36 (diff)
Merge PR #7116: Fixes #7110: missing test on the absence of a "as" while looking for a notation for a nested pattern
Diffstat (limited to 'interp')
-rw-r--r--interp/constrextern.ml3
-rw-r--r--interp/notation_ops.ml4
2 files changed, 4 insertions, 3 deletions
diff --git a/interp/constrextern.ml b/interp/constrextern.ml
index bb5fd5294..7792eff66 100644
--- a/interp/constrextern.ml
+++ b/interp/constrextern.ml
@@ -478,7 +478,8 @@ and extern_notation_pattern (tmp_scope,scopes as allscopes) vars t = function
if is_inactive_rule keyrule then raise No_match;
let loc = t.loc in
match DAst.get t with
- | PatCstr (cstr,_,na) ->
+ | PatCstr (cstr,args,na) ->
+ let t = if na = Anonymous then t else DAst.make ?loc (PatCstr (cstr,args,Anonymous)) in
let p = apply_notation_to_pattern ?loc (ConstructRef cstr)
(match_notation_constr_cases_pattern t pat) allscopes vars keyrule in
insert_pat_alias ?loc p na
diff --git a/interp/notation_ops.ml b/interp/notation_ops.ml
index a0d69ce79..aa9a6ed0d 100644
--- a/interp/notation_ops.ml
+++ b/interp/notation_ops.ml
@@ -1335,10 +1335,10 @@ let rec match_cases_pattern metas (terms,termlists,(),() as sigma) a1 a2 =
match DAst.get a1, a2 with
| r1, NVar id2 when Id.List.mem_assoc id2 metas -> (bind_env_cases_pattern sigma id2 a1),(0,[])
| PatVar Anonymous, NHole _ -> sigma,(0,[])
- | PatCstr ((ind,_ as r1),largs,_), NRef (ConstructRef r2) when eq_constructor r1 r2 ->
+ | PatCstr ((ind,_ as r1),largs,Anonymous), NRef (ConstructRef r2) when eq_constructor r1 r2 ->
let l = try add_patterns_for_params_remove_local_defs r1 largs with Not_found -> raise No_match in
sigma,(0,l)
- | PatCstr ((ind,_ as r1),args1,_), NApp (NRef (ConstructRef r2),l2)
+ | PatCstr ((ind,_ as r1),args1,Anonymous), NApp (NRef (ConstructRef r2),l2)
when eq_constructor r1 r2 ->
let l1 = try add_patterns_for_params_remove_local_defs r1 args1 with Not_found -> raise No_match in
let le2 = List.length l2 in