X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fparser%2FParser.y.pp;h=f9a6945f79529747b6afdcca79eee49206680ee8;hb=e33c65e18c77b1c21bd3b10a594b6ad61171ecb0;hp=3bb5ab4f094bdcb871a9a27795c49b86a8f3e929;hpb=16513d4899e167d20e120c2b3907230b7ff9dd83;p=ghc-hetmet.git diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp index 3bb5ab4..f9a6945 100644 --- a/compiler/parser/Parser.y.pp +++ b/compiler/parser/Parser.y.pp @@ -342,10 +342,13 @@ maybeexports :: { Maybe [LIE RdrName] } : '(' exportlist ')' { Just $2 } | {- empty -} { Nothing } -exportlist :: { [LIE RdrName] } - : exportlist ',' export { $3 : $1 } - | exportlist ',' { $1 } - | export { [$1] } +exportlist :: { [LIE RdrName] } + : ',' { [] } + | exportlist1 { $1 } + +exportlist1 :: { [LIE RdrName] } + : export { [$1] } + | export ',' exportlist { $1 : $3 } | {- empty -} { [] } -- No longer allow things like [] and (,,,) to be exported @@ -399,8 +402,8 @@ maybeimpspec :: { Located (Maybe (Bool, [LIE RdrName])) } | {- empty -} { noLoc Nothing } impspec :: { Located (Bool, [LIE RdrName]) } - : '(' exportlist ')' { LL (False, reverse $2) } - | 'hiding' '(' exportlist ')' { LL (True, reverse $3) } + : '(' exportlist ')' { LL (False, $2) } + | 'hiding' '(' exportlist ')' { LL (True, $3) } ----------------------------------------------------------------------------- -- Fixity Declarations @@ -750,7 +753,7 @@ gadt_constr :: { LConDecl RdrName } { LL (mkGadtDecl $1 $3) } -- Syntax: Maybe merge the record stuff with the single-case above? -- (to kill the mostly harmless reduce/reduce error) - -- XXX revisit autrijus + -- XXX revisit audreyt | constr_stuff_record '::' sigtype { let (con,details) = unLoc $1 in LL (ConDecl con Implicit [] (noLoc []) details (ResTyGADT $3)) }