diff options
| author | herbelin | 2002-11-19 08:35:14 +0000 |
|---|---|---|
| committer | herbelin | 2002-11-19 08:35:14 +0000 |
| commit | 116ca3333cc918e6e064703e66e28b739168e235 (patch) | |
| tree | a07a526f3e4b43cd3d393a45e49e318aaf0b3eba | |
| parent | b645fcd4c0b013de21a352aab7da3edaa52d3637 (diff) | |
Autoriser les abbreviations de Cases
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@3257 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | interp/topconstr.ml | 1 | ||||
| -rw-r--r-- | toplevel/metasyntax.ml | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/interp/topconstr.ml b/interp/topconstr.ml index 628532d7b3..8d16602b5c 100644 --- a/interp/topconstr.ml +++ b/interp/topconstr.ml @@ -298,7 +298,6 @@ let map_constr_expr_with_binders f g e = function | CHole _ | CMeta _ | CSort _ | CNumeral _ | CDynamic _ | CRef _ as x -> x | CCases (loc,po,a,bl) -> (* TODO: apply g on the binding variables in pat... *) - (* hard because no syntactic diff between a constructor and a var *) let bl = List.map (fun (loc,pat,rhs) -> (loc,pat,f e rhs)) bl in CCases (loc,option_app (f e) po,List.map (f e) a,bl) | COrderedCase (loc,s,po,a,bl) -> diff --git a/toplevel/metasyntax.ml b/toplevel/metasyntax.ml index 14f9de51d7..4da4a83bc7 100644 --- a/toplevel/metasyntax.ml +++ b/toplevel/metasyntax.ml @@ -57,6 +57,11 @@ let make_aconstr vars a = | RLambda (_,na,ty,c) -> add_name bound_binders na; ALambda (na,aux ty,aux c) | RProd (_,na,ty,c) -> add_name bound_binders na; AProd (na,aux ty,aux c) | RLetIn (_,na,b,c) -> add_name bound_binders na; ALetIn (na,aux b,aux c) + | RCases (_,tyopt,tml,eqnl) -> + let f (_,idl,pat,rhs) = + bound_binders := idl@(!bound_binders); + (idl,pat,aux rhs) in + ACases (option_app aux tyopt,List.map aux tml, List.map f eqnl) | ROrderedCase (_,b,tyopt,tm,bv) -> AOldCase (b,option_app aux tyopt,aux tm, Array.map aux bv) | RCast (_,c,t) -> ACast (aux c,aux t) @@ -64,7 +69,7 @@ let make_aconstr vars a = | RHole (_,w) -> AHole w | RRef (_,r) -> ARef r | RMeta (_,n) -> AMeta n - | RDynamic _ | RRec _ | RCases _ | REvar _ -> + | RDynamic _ | RRec _ | REvar _ -> error "Fixpoints, cofixpoints, existential variables and pattern-matching not \ allowed in abbreviatable expressions" in |
