Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
d9d7ceaa
Commit
d9d7ceaa
authored
Aug 15, 2003
by
igloo
Browse files
[project @ 2003-08-15 15:53:00 by igloo]
Add support for splicing in foreign exports.
parent
3072ee8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/hsSyn/Convert.lhs
View file @
d9d7ceaa
...
...
@@ -33,8 +33,10 @@ import TyCon ( DataConDetails(..) )
import Type ( Type )
import BasicTypes( Boxity(..), RecFlag(Recursive),
NewOrData(..), StrictnessMark(..) )
import ForeignCall ( Safety(..), CCallConv(..), CCallTarget(..) )
import HsDecls ( CImportSpec(..), ForeignImport(..), ForeignDecl(..) )
import ForeignCall ( Safety(..), CCallConv(..), CCallTarget(..),
CExportSpec(..))
import HsDecls ( CImportSpec(..), ForeignImport(..), ForeignExport(..),
ForeignDecl(..) )
import FastString( FastString, mkFastString, nilFS )
import Char ( ord, isAscii, isAlphaNum, isAlpha )
import List ( partition )
...
...
@@ -120,6 +122,13 @@ cvt_top (ForeignD (ImportF callconv safety from nm typ))
Threadsafe -> PlaySafe True
parsed = parse_ccall_impent nm from
cvt_top (ForeignD (ExportF callconv as nm typ))
= let e = CExport (CExportStatic (mkFastString as) callconv')
in Left $ ForD (ForeignExport (vName nm) (cvtType typ) e False loc0)
where callconv' = case callconv of
CCall -> CCallConv
StdCall -> StdCallConv
parse_ccall_impent :: String -> String -> Maybe (FastString, CImportSpec)
parse_ccall_impent nm s
= case lex_ccall_impent s of
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment