summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f901ffc)
On reflection, using the '!!' prefix for unboxing a constructor field
was a mistake: firstly it has to be written '! !', and secondly it
isn't backwards-compatible. So instead, we now use the syntax:
data T = T {-# UNPACK #-} !Int
to unbox a field. We thought this would be a cute reuse of the UNPACK
pragma.
The effect of -funbox-strict-fields is to add {-# UNPACK #-} to every
strict field.
{ token ITdeprecated_prag }
"{-#" $whitechar* (SCC|scc) { token ITscc_prag }
"{-#" $whitechar* (CORE|core) { token ITcore_prag }
{ token ITdeprecated_prag }
"{-#" $whitechar* (SCC|scc) { token ITscc_prag }
"{-#" $whitechar* (CORE|core) { token ITcore_prag }
+ "{-#" $whitechar* (UNPACK|unpack) { token ITunpack_prag }
| ITline_prag
| ITscc_prag
| ITcore_prag -- hdaume: core annotations
| ITline_prag
| ITscc_prag
| ITcore_prag -- hdaume: core annotations
| ITclose_prag
| ITdotdot -- reserved symbols
| ITclose_prag
| ITdotdot -- reserved symbols
{- -*-haskell-*-
-----------------------------------------------------------------------------
{- -*-haskell-*-
-----------------------------------------------------------------------------
-$Id: Parser.y,v 1.130 2003/11/26 10:07:19 simonmar Exp $
+$Id: Parser.y,v 1.131 2003/11/27 13:26:39 simonmar Exp $
'{-# CORE' { T _ _ ITcore_prag } -- hdaume: annotated core
'{-# SCC' { T _ _ ITscc_prag }
'{-# DEPRECATED' { T _ _ ITdeprecated_prag }
'{-# 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
'#-}' { T _ _ ITclose_prag }
'..' { T _ _ ITdotdot } -- reserved symbols
strict_mark :: { HsBang }
: '!' { HsStrict }
strict_mark :: { HsBang }
: '!' { HsStrict }
+ | '{-# UNPACK' '#-}' '!' { HsUnbox }
deriving :: { Maybe RdrNameContext }
: {- empty -} { Nothing }
deriving :: { Maybe RdrNameContext }
: {- empty -} { Nothing }