Added parsing rule for BangPattern in case expr
[ghc-hetmet.git] / compiler / parser / Parser.y.pp
index 1ad8d5f..898d45c 100644 (file)
@@ -753,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)) }
@@ -1104,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)) }