X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fparser%2FParser.y.pp;h=898d45c5e9614ae22cb60e4bc774e2371312a4c0;hp=1469a668c5f0a06f70108e7ef657de02016f9876;hb=a8839bb4c0a25a961ea315fa2cfdcc78b44b8878;hpb=e70246a799b0038cf84874550283c52858231159 diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp index 1469a66..898d45c 100644 --- a/compiler/parser/Parser.y.pp +++ b/compiler/parser/Parser.y.pp @@ -342,7 +342,11 @@ maybeexports :: { Maybe [LIE RdrName] } : '(' exportlist ')' { Just $2 } | {- empty -} { Nothing } -exportlist :: { [LIE RdrName] } +exportlist :: { [LIE RdrName] } + : ',' { [] } + | exportlist1 { $1 } + +exportlist1 :: { [LIE RdrName] } : export { [$1] } | export ',' exportlist { $1 : $3 } | {- empty -} { [] } @@ -398,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 @@ -749,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)) } @@ -1100,6 +1104,8 @@ alts1 :: { Located [LMatch RdrName] } alt :: { LMatch RdrName } : infixexp opt_sig alt_rhs {% checkPattern $1 >>= \p -> return (LL (Match [p] $2 (unLoc $3))) } + | '!' infixexp opt_sig alt_rhs {% checkPattern $2 >>= \p -> + return (LL (Match [LL $ BangPat p] $3 (unLoc $4))) } alt_rhs :: { Located (GRHSs RdrName) } : ralt wherebinds { LL (GRHSs (unLoc $1) (unLoc $2)) }