Commit e9e72bd1 authored by simonmar's avatar simonmar

[project @ 2003-11-27 13:26:38 by simonmar]

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.
parent f901ffc8
......@@ -174,6 +174,7 @@ $white_no_nl+ ;
{ token ITdeprecated_prag }
"{-#" $whitechar* (SCC|scc) { token ITscc_prag }
"{-#" $whitechar* (CORE|core) { token ITcore_prag }
"{-#" $whitechar* (UNPACK|unpack) { token ITunpack_prag }
"{-#" { nested_comment }
......@@ -349,6 +350,7 @@ data Token__
| ITline_prag
| ITscc_prag
| ITcore_prag -- hdaume: core annotations
| ITunpack_prag
| ITclose_prag
| ITdotdot -- reserved symbols
......
{- -*-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 $
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 }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment