{- -*-haskell-*-
-----------------------------------------------------------------------------
-$Id: Parser.y,v 1.95 2002/04/02 13:56:32 simonmar Exp $
+$Id: Parser.y,v 1.96 2002/04/29 14:03:57 simonmar Exp $
Haskell grammar.
fdecl1DEPRECATED
----------- DEPRECATED label decls ------------
: 'label' ext_name varid '::' sigtype
- { ForeignImport $3 $5 (CImport defaultCCallConv (PlaySafe False) _NIL_ _NIL_
+ { ForeignImport $3 $5 (CImport defaultCCallConv (PlaySafe False) nilFS nilFS
(CLabel ($2 `orElse` mkExtName $3))) }
----------- DEPRECATED ccall/stdcall decls ------------
{ let
target = StaticTarget ($2 `orElse` mkExtName $4)
in
- ForeignImport $4 $6 (CImport defaultCCallConv $3 _NIL_ _NIL_
+ ForeignImport $4 $6 (CImport defaultCCallConv $3 nilFS nilFS
(CFunction target)) }
-- DEPRECATED variant #2: external name consists of two separate strings
let
imp = CFunction (StaticTarget $4)
in
- ForeignImport $6 $8 (CImport cconv $5 _NIL_ _NIL_ imp) }
+ ForeignImport $6 $8 (CImport cconv $5 nilFS nilFS imp) }
-- DEPRECATED variant #3: `unsafe' after entity
| 'import' callconv STRING 'unsafe' varid_no_unsafe '::' sigtype
let
imp = CFunction (StaticTarget $3)
in
- ForeignImport $5 $7 (CImport cconv PlayRisky _NIL_ _NIL_ imp) }
+ ForeignImport $5 $7 (CImport cconv PlayRisky nilFS nilFS imp) }
-- DEPRECATED variant #4: use of the special identifier `dynamic' without
-- an explicit calling convention (import)
| 'import' {-no callconv-} 'dynamic' safety varid_no_unsafe '::' sigtype
- { ForeignImport $4 $6 (CImport defaultCCallConv $3 _NIL_ _NIL_
+ { ForeignImport $4 $6 (CImport defaultCCallConv $3 nilFS nilFS
(CFunction DynamicTarget)) }
-- DEPRECATED variant #5: use of the special identifier `dynamic' (import)
{% case $2 of
DNCall -> parseError "Illegal format of .NET foreign import"
CCall cconv -> returnP $
- ForeignImport $5 $7 (CImport cconv $4 _NIL_ _NIL_
+ ForeignImport $5 $7 (CImport cconv $4 nilFS nilFS
(CFunction DynamicTarget)) }
-- DEPRECATED variant #6: lack of a calling convention specification
-- DEPRECATED variant #8: use of the special identifier `dynamic' without
-- an explicit calling convention (export)
| 'export' {-no callconv-} 'dynamic' varid '::' sigtype
- { ForeignImport $3 $5 (CImport defaultCCallConv (PlaySafe False) _NIL_ _NIL_
+ { ForeignImport $3 $5 (CImport defaultCCallConv (PlaySafe False) nilFS nilFS
CWrapper) }
-- DEPRECATED variant #9: use of the special identifier `dynamic' (export)
{% case $2 of
DNCall -> parseError "Illegal format of .NET foreign import"
CCall cconv -> returnP $
- ForeignImport $4 $6 (CImport cconv (PlaySafe False) _NIL_ _NIL_ CWrapper) }
+ ForeignImport $4 $6 (CImport cconv (PlaySafe False) nilFS nilFS CWrapper) }
----------- DEPRECATED .NET decls ------------
-- NB: removed the .NET call declaration, as it is entirely subsumed
| 'threadsafe' { PlaySafe True }
-- only needed to avoid conflicts with the DEPRECATED rules
-fspec :: { (FAST_STRING, RdrName, RdrNameHsType) }
+fspec :: { (FastString, RdrName, RdrNameHsType) }
: STRING varid '::' sigtype { ($1 , $2, $4) }
- | varid '::' sigtype { (SLIT(""), $1, $3) }
+ | varid '::' sigtype { (nilFS, $1, $3) }
-- if the entity string is missing, it defaults to the empty string;
-- the meaning of an empty entity string depends on the calling
-- convention
| fexp { $1 }
-scc_annot :: { FAST_STRING }
+scc_annot :: { FastString }
: '_scc_' STRING { $2 }
| '{-# SCC' STRING '#-}' { $2 }
-ccallid :: { FAST_STRING }
+ccallid :: { FastString }
: VARID { $1 }
| CONID { $1 }