From b7e6df6ff46c2eaad9cd6a0f1f0d21bc0c3b4c61 Mon Sep 17 00:00:00 2001 From: herbelin Date: Wed, 15 Oct 2003 13:40:49 +0000 Subject: Mise en conformite return_type en fonction de la doc git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@4643 85f007b7-540e-0410-9357-904b9bb8a0f7 --- parsing/g_constrnew.ml4 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'parsing/g_constrnew.ml4') diff --git a/parsing/g_constrnew.ml4 b/parsing/g_constrnew.ml4 index 9a9cf9a59..6fa833275 100644 --- a/parsing/g_constrnew.ml4 +++ b/parsing/g_constrnew.ml4 @@ -255,7 +255,7 @@ GEXTEND Gram | -> None ] ] ; match_constr: - [ [ "match"; ci=LIST1 case_item SEP ","; ty=case_type; "with"; + [ [ "match"; ci=LIST1 case_item SEP ","; ty=OPT case_type; "with"; br=branches; "end" -> mk_match (loc,ci,ty,br) ] ] ; case_item: @@ -270,11 +270,15 @@ GEXTEND Gram ty = OPT ["in"; t=lconstr -> t] -> (ona,ty) ] ] ; case_type: - [ [ ty = OPT [ "return"; c = operconstr LEVEL "100" -> c ] -> ty ] ] + [ [ "return"; ty = operconstr LEVEL "100" -> ty ] ] ; return_type: - [ [ na = ["as"; id=name -> snd id | -> Names.Anonymous]; - ty = case_type -> (na,ty) ] ] + [ [ a = OPT [ na = ["as"; id=name -> snd id | -> Names.Anonymous]; + ty = case_type -> (na,ty) ] -> + match a with + | None -> Names.Anonymous, None + | Some (na,t) -> (na, Some t) + ] ] ; branches: [ [ OPT"|"; br=LIST0 eqn SEP "|" -> br ] ] -- cgit v1.2.3