X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fparser%2FParserCore.y;h=7b82ebad22fb5ff222c00bfc34ebe6f095ebd1d1;hp=3210583f9651cfa70247dadca7adafb2fa17fd42;hb=4db2c92cedd11b90c6cec46c245b3b618f734d49;hpb=b764b3450fd52ead0ea7cb1cc1b609e423f9b3b1 diff --git a/compiler/parser/ParserCore.y b/compiler/parser/ParserCore.y index 3210583..7b82eba 100644 --- a/compiler/parser/ParserCore.y +++ b/compiler/parser/ParserCore.y @@ -82,7 +82,7 @@ tdefs :: { [TyClDecl RdrName] } | tdef ';' tdefs {$1:$3} tdef :: { TyClDecl RdrName } - : '%data' q_tc_name tv_bndrs '=' '{' cons1 '}' + : '%data' q_tc_name tv_bndrs '=' '{' cons '}' { mkTyData DataType (noLoc [], noLoc (ifaceExtRdrName $2), map toHsTvBndr $3) Nothing $6 Nothing } | '%newtype' q_tc_name tv_bndrs trep { let tc_rdr = ifaceExtRdrName $2 in @@ -97,9 +97,9 @@ trep :: { OccName -> [LConDecl RdrName] } in [noLoc $ ConDecl (noLoc dc_name) Explicit [] (noLoc []) con_info ResTyH98]) } -cons1 :: { [LConDecl RdrName] } - : con { [$1] } - | con ';' cons1 { $1:$3 } +cons :: { [LConDecl RdrName] } + : {- empty -} { [] } -- 20060420 Empty data types allowed. jds + | con ';' cons { $1:$3 } con :: { LConDecl RdrName } : d_pat_occ attv_bndrs hs_atys