[project @ 2001-07-05 08:55:29 by simonpj]
[ghc-hetmet.git] / ghc / compiler / parser / ParseUtil.lhs
index 5c4e6a4..7334806 100644 (file)
@@ -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
@@ -38,11 +38,10 @@ import RdrHsSyn             ( RdrBinding(..),
                        )
 import RdrName
 import PrelNames       ( unitTyCon_RDR )
-import CallConv
 import OccName         ( dataName, varName, tcClsName,
                          occNameSpace, setOccNameSpace, occNameUserString )
+import CStrings                ( CLabelString )
 import FastString      ( unpackFS )
-import UniqFM          ( UniqFM, listToUFM, lookupUFM )
 import Outputable
 
 -----------------------------------------------------------------------------
@@ -68,7 +67,7 @@ mkVanillaCon :: RdrNameHsType -> [RdrNameBangType] -> P (RdrName, RdrNameConDeta
 mkVanillaCon ty tys
  = split ty tys
  where
-   split (HsAppTy t u)  ts = split t (Unbanged u : ts)
+   split (HsAppTy t u)  ts = split t (unbangedType u : ts)
    split (HsTyVar tc)   ts = tyConToDataCon tc `thenP` \ data_con ->
                             returnP (data_con, VanillaCon ts)
    split _              _ = parseError "Illegal data/newtype declaration"
@@ -91,15 +90,6 @@ tyConToDataCon tc
 ----------------------------------------------------------------------------
 -- Various Syntactic Checks
 
-callConvFM :: UniqFM CallConv
-callConvFM = listToUFM $
-      map (\ (x,y) -> (_PK_ x,y))
-     [  ("stdcall",  stdCallConv),
-       ("ccall",    cCallConv)
---     ("pascal",   pascalCallConv),
---     ("fastcall", fastCallConv)
-     ]
-
 checkInstType :: RdrNameHsType -> P RdrNameHsType
 checkInstType t 
   = case t of
@@ -168,7 +158,7 @@ checkSimple t _ = parseError "Illegal left hand side in data/newtype declaration
 
 checkDo []            = parseError "Empty 'do' construct"
 checkDo [ExprStmt e l] = returnP [ResultStmt e l]
-checkDo [s]           = parseError "The last statment in a 'do' construct must be an expression"
+checkDo [s]           = parseError "The last statement in a 'do' construct must be an expression"
 checkDo (s:ss)        = checkDo ss     `thenP` \ ss' ->
                         returnP (s:ss')
 
@@ -314,10 +304,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