[project @ 2003-11-27 13:26:38 by simonmar]
[ghc-hetmet.git] / ghc / compiler / parser / Parser.y
index 68cc7ea..965863a 100644 (file)
@@ -1,6 +1,6 @@
 {-                                                             -*-haskell-*-
 -----------------------------------------------------------------------------
-$Id: Parser.y,v 1.129 2003/11/06 17:09:53 simonpj Exp $
+$Id: Parser.y,v 1.131 2003/11/27 13:26:39 simonmar Exp $
 
 Haskell grammar.
 
@@ -137,6 +137,7 @@ Conflicts: 29 shift/reduce, [SDM 19/9/2002]
  '{-# CORE'        { T _ _ ITcore_prag }              -- hdaume: annotated core
  '{-# SCC'        { T _ _ ITscc_prag }
  '{-# DEPRECATED'  { T _ _ ITdeprecated_prag }
+ '{-# UNPACK'      { T _ _ ITunpack_prag }
  '#-}'            { T _ _ ITclose_prag }
 
  '..'          { T _ _ ITdotdot }                      -- reserved symbols
@@ -827,7 +828,7 @@ stype :: { RdrNameBangType }
 
 strict_mark :: { HsBang }
        : '!'                           { HsStrict }
-       | '!' '!'                       { HsUnbox }
+       | '{-# UNPACK' '#-}' '!'        { HsUnbox }
 
 deriving :: { Maybe RdrNameContext }
        : {- empty -}                   { Nothing }
@@ -951,7 +952,7 @@ aexp        :: { RdrNameHsExpr }
        | aexp1                         { $1 }
 
 aexp1  :: { RdrNameHsExpr }
-        : aexp1 '{' fbinds '}'                 {% (mkRecConstrOrUpdate $1 (reverse $3)) }
+        : aexp1 '{' fbinds '}'         {% (mkRecConstrOrUpdate $1 (reverse $3)) }
        | aexp2                         { $1 }
 
 -- Here was the syntax for type applications that I was planning
@@ -1148,12 +1149,14 @@ qual  :: { RdrNameStmt }
 -----------------------------------------------------------------------------
 -- Record Field Update/Construction
 
-fbinds         :: { RdrNameHsRecordBinds }
-       : fbinds ',' fbind              { $3 : $1 }
-       | fbinds ','                    { $1 }
-       | fbind                         { [$1] }
+fbinds :: { RdrNameHsRecordBinds }
+       : fbinds1                       { $1 }
        | {- empty -}                   { [] }
 
+fbinds1        :: { RdrNameHsRecordBinds }
+       : fbinds1 ',' fbind             { $3 : $1 }
+       | fbind                         { [$1] }
+
 fbind  :: { (RdrName, RdrNameHsExpr) }
        : qvar '=' exp                  { ($1,$3) }