From 2b07881409dbffadb207d09ce82eeb4cde9a762c Mon Sep 17 00:00:00 2001 From: simonpj Date: Fri, 6 Oct 2000 09:31:45 +0000 Subject: [PATCH] [project @ 2000-10-06 09:31:45 by simonpj] Allow finite number of (!) fields in constructors :-) --- ghc/compiler/parser/Parser.y | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/parser/Parser.y b/ghc/compiler/parser/Parser.y index 53fcbd4..ecfaf2d 100644 --- a/ghc/compiler/parser/Parser.y +++ b/ghc/compiler/parser/Parser.y @@ -1,6 +1,6 @@ {- ----------------------------------------------------------------------------- -$Id: Parser.y,v 1.39 2000/10/05 22:50:18 andy Exp $ +$Id: Parser.y,v 1.40 2000/10/06 09:31:45 simonpj Exp $ Haskell grammar. @@ -595,19 +595,20 @@ context :: { RdrNameContext } constr_stuff :: { (RdrName, RdrNameConDetails) } : btype {% mkVanillaCon $1 [] } | btype '!' atype satypes {% mkVanillaCon $1 (Banged $3 : $4) } - | gtycon '{' fielddecls '}' {% mkRecCon $1 (reverse $3) } + | gtycon '{' fielddecls '}' {% mkRecCon $1 $3 } | sbtype conop sbtype { ($2, InfixCon $1 $3) } satypes :: { [RdrNameBangType] } : atype satypes { Unbanged $1 : $2 } | '!' atype satypes { Banged $2 : $3 } + | {- empty -} { [] } sbtype :: { RdrNameBangType } : btype { Unbanged $1 } | '!' atype { Banged $2 } fielddecls :: { [([RdrName],RdrNameBangType)] } - : fielddecls ',' fielddecl { $3 : $1 } + : fielddecl ',' fielddecls { $1 : $3 } | fielddecl { [$1] } fielddecl :: { ([RdrName],RdrNameBangType) } -- 1.7.10.4