summaryrefslogtreecommitdiff
path: root/ghc/compiler/parser/ParseUtil.lhs
diff options
context:
space:
mode:
authorsimonpj <unknown>2001-05-24 13:59:12 +0000
committersimonpj <unknown>2001-05-24 13:59:12 +0000
commitcbdeae8fc8a1c72d20d89241acae8a313214b51c (patch)
tree2bde25b0907554080b9ee1e92446f575f87e04eb /ghc/compiler/parser/ParseUtil.lhs
parentf70aaa982380a9d210ca136983eb62e7b35062c7 (diff)
downloadhaskell-cbdeae8fc8a1c72d20d89241acae8a313214b51c.tar.gz
[project @ 2001-05-24 13:59:09 by simonpj]
------------------------------------------------------ More stuff towards generalising 'foreign' declarations ------------------------------------------------------ This is the second step towards generalising 'foreign' declarations to handle langauges other than C. Now I can handle foreign import dotnet type T foreign import dotnet "void Foo.Baz.f( T )" f :: T -> IO () ** WARNING ** I believe that all the foreign stuff for C should work exactly as before, but I have not tested it thoroughly. Sven, Manuel, Marcin: please give it a whirl and compare old with new output. Lots of fiddling around with data types. The main changes are * HsDecls.lhs The ForeignDecl type and its friends Note also the ForeignType constructor to TyClDecl * ForeignCall.lhs Here's where the stuff that survives right through compilation lives * TcForeign.lhs DsForeign.lhs Substantial changes driven by the new data types * Parser.y ParseIface.y RnSource Just what you'd expect
Diffstat (limited to 'ghc/compiler/parser/ParseUtil.lhs')
-rw-r--r--ghc/compiler/parser/ParseUtil.lhs9
1 files changed, 4 insertions, 5 deletions
diff --git a/ghc/compiler/parser/ParseUtil.lhs b/ghc/compiler/parser/ParseUtil.lhs
index 51bc199117..47381dc930 100644
--- a/ghc/compiler/parser/ParseUtil.lhs
+++ b/ghc/compiler/parser/ParseUtil.lhs
@@ -12,7 +12,7 @@ module ParseUtil (
, mkRecConstrOrUpdate -- HsExp -> [HsFieldUpdate] -> P HsExp
, groupBindings
- , mkExtName -- Maybe ExtName -> RdrName -> ExtName
+ , mkExtName -- RdrName -> ExtName
, checkPrec -- String -> P String
, checkContext -- HsType -> P HsContext
@@ -41,6 +41,7 @@ import PrelNames ( unitTyCon_RDR )
import ForeignCall ( CCallConv(..) )
import OccName ( dataName, varName, tcClsName,
occNameSpace, setOccNameSpace, occNameUserString )
+import CStrings ( CLabelString )
import FastString ( unpackFS )
import UniqFM ( UniqFM, listToUFM )
import Outputable
@@ -305,10 +306,8 @@ mkRecConstrOrUpdate _ _
-- want z-encoding (e.g. names with z's in them shouldn't be doubled)
-- (This is why we use occNameUserString.)
-mkExtName :: Maybe ExtName -> RdrName -> ExtName
-mkExtName Nothing rdrNm = ExtName (_PK_ (occNameUserString (rdrNameOcc rdrNm)))
- Nothing
-mkExtName (Just x) _ = x
+mkExtName :: RdrName -> CLabelString
+mkExtName rdrNm = _PK_ (occNameUserString (rdrNameOcc rdrNm))
-----------------------------------------------------------------------------
-- group function bindings into equation groups