diff options
Diffstat (limited to 'compiler/hsSyn')
-rw-r--r-- | compiler/hsSyn/Convert.lhs | 12 | ||||
-rw-r--r-- | compiler/hsSyn/HsImpExp.lhs | 8 | ||||
-rw-r--r-- | compiler/hsSyn/HsSyn.lhs | 4 |
3 files changed, 14 insertions, 10 deletions
diff --git a/compiler/hsSyn/Convert.lhs b/compiler/hsSyn/Convert.lhs index 77e9e08224..88d8954bf1 100644 --- a/compiler/hsSyn/Convert.lhs +++ b/compiler/hsSyn/Convert.lhs @@ -17,9 +17,10 @@ import HsSyn as Hs import qualified Class (FunDep) import RdrName ( RdrName, mkRdrUnqual, mkRdrQual, mkOrig, getRdrName, nameRdrName ) import qualified Name ( Name, mkInternalName, getName ) -import Module ( Module, mkModule ) +import Module ( ModuleName, mkModuleName, mkModule ) import RdrHsSyn ( mkClassDecl, mkTyData ) import qualified OccName +import PackageConfig ( PackageId, stringToPackageId ) import OccName ( startsVarId, startsVarSym, startsConId, startsConSym, pprNameSpace ) import SrcLoc ( Located(..), SrcSpan ) @@ -569,7 +570,7 @@ thRdrName :: OccName.NameSpace -> String -> TH.NameFlavour -> RdrName -- which will give confusing error messages later -- -- The strict applications ensure that any buried exceptions get forced -thRdrName ctxt_ns occ (TH.NameG th_ns mod) = (mkOrig $! (mk_mod mod)) $! (mk_occ (mk_ghc_ns th_ns) occ) +thRdrName ctxt_ns occ (TH.NameG th_ns pkg mod) = (mkOrig $! (mkModule (mk_pkg pkg) (mk_mod mod))) $! (mk_occ (mk_ghc_ns th_ns) occ) thRdrName ctxt_ns occ (TH.NameL uniq) = nameRdrName $! (((Name.mkInternalName $! (mk_uniq uniq)) $! (mk_occ ctxt_ns occ)) noSrcLoc) thRdrName ctxt_ns occ (TH.NameQ mod) = (mkRdrQual $! (mk_mod mod)) $! (mk_occ ctxt_ns occ) thRdrName ctxt_ns occ (TH.NameU uniq) = mkRdrUnqual $! (mk_uniq_occ ctxt_ns occ uniq) @@ -617,8 +618,11 @@ mk_ghc_ns TH.DataName = OccName.dataName mk_ghc_ns TH.TcClsName = OccName.tcClsName mk_ghc_ns TH.VarName = OccName.varName -mk_mod :: TH.ModName -> Module -mk_mod mod = mkModule (TH.modString mod) +mk_mod :: TH.ModName -> ModuleName +mk_mod mod = mkModuleName (TH.modString mod) + +mk_pkg :: TH.ModName -> PackageId +mk_pkg pkg = stringToPackageId (TH.pkgString pkg) mk_uniq :: Int# -> Unique mk_uniq u = mkUniqueGrimily (I# u) diff --git a/compiler/hsSyn/HsImpExp.lhs b/compiler/hsSyn/HsImpExp.lhs index 220afb7499..f63d86aec2 100644 --- a/compiler/hsSyn/HsImpExp.lhs +++ b/compiler/hsSyn/HsImpExp.lhs @@ -8,7 +8,7 @@ module HsImpExp where #include "HsVersions.h" -import Module ( Module ) +import Module ( ModuleName ) import Outputable import FastString import SrcLoc ( Located(..) ) @@ -26,10 +26,10 @@ One per \tr{import} declaration in a module. type LImportDecl name = Located (ImportDecl name) data ImportDecl name - = ImportDecl (Located Module) -- module name + = ImportDecl (Located ModuleName) -- module name Bool -- True <=> {-# SOURCE #-} import Bool -- True => qualified - (Maybe Module) -- as Module + (Maybe ModuleName) -- as Module (Maybe (Bool, [LIE name])) -- (True => hiding, names) \end{code} @@ -72,7 +72,7 @@ data IE name | IEThingAbs name -- Class/Type (can't tell) | IEThingAll name -- Class/Type plus all methods/constructors | IEThingWith name [name] -- Class/Type plus some methods/constructors - | IEModuleContents Module -- (Export Only) + | IEModuleContents ModuleName -- (Export Only) \end{code} \begin{code} diff --git a/compiler/hsSyn/HsSyn.lhs b/compiler/hsSyn/HsSyn.lhs index a9982a630a..0efa1e32c8 100644 --- a/compiler/hsSyn/HsSyn.lhs +++ b/compiler/hsSyn/HsSyn.lhs @@ -40,14 +40,14 @@ import HsUtils import IfaceSyn ( IfaceBinding ) import Outputable import SrcLoc ( Located(..) ) -import Module ( Module ) +import Module ( Module, ModuleName ) \end{code} All we actually declare here is the top-level structure for a module. \begin{code} data HsModule name = HsModule - (Maybe (Located Module))-- Nothing => "module X where" is omitted + (Maybe (Located ModuleName))-- Nothing => "module X where" is omitted -- (in which case the next field is Nothing too) (Maybe [LIE name]) -- Export list; Nothing => export list omitted, so export everything -- Just [] => export *nothing* |