{- -*-haskell-*-
-----------------------------------------------------------------------------
-$Id: Parser.y,v 1.123 2003/09/16 13:03:44 simonmar Exp $
+$Id: Parser.y,v 1.125 2003/09/24 13:04:51 simonmar Exp $
Haskell grammar.
'safe' { T _ _ ITsafe }
'threadsafe' { T _ _ ITthreadsafe }
'unsafe' { T _ _ ITunsafe }
- 'with' { T _ _ ITwith }
'mdo' { T _ _ ITmdo }
'stdcall' { T _ _ ITstdcallconv }
'ccall' { T _ _ ITccallconv }
binds :: { RdrNameHsBinds } -- May have implicit parameters
: decllist { cvBinds $1 }
- | '{' dbinds '}' { IPBinds $2 False{-not with-} }
- | vocurly dbinds close { IPBinds $2 False{-not with-} }
+ | '{' dbinds '}' { IPBinds $2 }
+ | vocurly dbinds close { IPBinds $2 }
wherebinds :: { RdrNameHsBinds } -- May have implicit parameters
: 'where' binds { $2 }
constr_stuff :: { (RdrName, RdrNameConDetails) }
: btype {% mkPrefixCon $1 [] }
- | btype '!' atype satypes {% mkPrefixCon $1 (BangType MarkedUserStrict $3 : $4) }
+ | btype strict_mark atype satypes {% mkPrefixCon $1 (BangType $2 $3 : $4) }
| oqtycon '{' '}' {% mkRecCon $1 [] }
| oqtycon '{' fielddecls '}' {% mkRecCon $1 $3 }
| sbtype conop sbtype { ($2, InfixCon $1 $3) }
satypes :: { [RdrNameBangType] }
: atype satypes { unbangedType $1 : $2 }
- | '!' atype satypes { BangType MarkedUserStrict $2 : $3 }
+ | strict_mark atype satypes { BangType $1 $2 : $3 }
| {- empty -} { [] }
sbtype :: { RdrNameBangType }
: btype { unbangedType $1 }
- | '!' atype { BangType MarkedUserStrict $2 }
+ | strict_mark atype { BangType $1 $2 }
fielddecls :: { [([RdrName],RdrNameBangType)] }
: fielddecl ',' fielddecls { $1 : $3 }
stype :: { RdrNameBangType }
: ctype { unbangedType $1 }
- | '!' atype { BangType MarkedUserStrict $2 }
+ | strict_mark atype { BangType $1 $2 }
+
+strict_mark :: { StrictnessMark }
+ : '!' { MarkedUserStrict }
+ | '!' '!' { MarkedUserUnboxed }
deriving :: { Maybe RdrNameContext }
: {- empty -} { Nothing }
exp :: { RdrNameHsExpr }
: infixexp '::' sigtype { ExprWithTySig $1 $3 }
- | infixexp 'with' dbinding { HsLet (IPBinds $3 True{-not a let-}) $1 }
| fexp srcloc '-<' exp { HsArrApp $1 $4 placeHolderType HsFirstOrderApp True $2 }
| fexp srcloc '>-' exp { HsArrApp $4 $1 placeHolderType HsFirstOrderApp False $2 }
| fexp srcloc '-<<' exp { HsArrApp $1 $4 placeHolderType HsHigherOrderApp True $2 }