Possible error with strict_mark in Parser.y

Simon Peyton Jones simonpj at microsoft.com
Mon Dec 1 22:13:01 UTC 2014


Thanks.  It was totally wrong.  I have fixed it. 

Simon

| -----Original Message-----
| From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of Jan
| Stolarek
| Sent: 01 December 2014 09:45
| To: ghc-devs at haskell.org
| Subject: Re: Possible error with strict_mark in Parser.y
| 
| Looking at the source code comments it seems that you're right:
| 
| data HsBang
|   = HsUserBang   -- The user's source-code request
|        (Maybe Bool)       -- Just True    {-# UNPACK #-}
|                           -- Just False   {-# NOUNPACK #-}
|                           -- Nothing      no pragma
|        Bool               -- True <=> '!' specified
| 
| 
| Can anyone confirm?
| 
| Janek
| 
| Dnia niedziela, 30 listopada 2014, Alan & Kim Zimmerman napisał:
| > If I look at the production for strict_mark in the parser
| >
| > https://github.com/ghc/ghc/blob/master/compiler/parser/Parser.y#L1355
| >
| > strict_mark :: { Located ([AddAnn],HsBang) }
| >
| >         : '!'                        { sL1 $1 ([],HsUserBang Nothing
| >
| > True) }
| >
| >         | '{-# UNPACK' '#-}'         { sLL $1 $> ([mo $1,mc
| $2],HsUserBang
| >
| > (Just True)  False) }
| >
| >         | '{-# NOUNPACK' '#-}'       { sLL $1 $> ([mo $1,mc
| $2],HsUserBang
| >
| > (Just False) True) } -- ***Correct?
| >
| >         | '{-# UNPACK' '#-}' '!'     { sLL $1 $> ([mo $1,mc
| $2],HsUserBang
| >
| > (Just True)  True) }
| >
| >         | '{-# NOUNPACK' '#-}' '!'   { sLL $1 $> ([mo $1,mc
| $2],HsUserBang
| >
| > (Just False) True) }
| >
| > I would expect the final True or False value to reflect the presence of
| the
| > '!' mark.
| >
| > But the second line has no '!' but returns True.
| >
| > I suspect this is an error.
| >
| > Alan
| 
| 
| 
| _______________________________________________
| ghc-devs mailing list
| ghc-devs at haskell.org
| http://www.haskell.org/mailman/listinfo/ghc-devs


More information about the ghc-devs mailing list