module BkpSyn (
HsUnitId(..),
LHsUnitId,
HsModuleSubst,
LHsModuleSubst,
HsModuleId(..),
LHsModuleId,
HsComponentId(..),
LHsUnit, HsUnit(..),
LHsUnitDecl, HsUnitDecl(..),
IncludeDecl(..),
LRenaming, Renaming(..),
) where
import GhcPrelude
import DriverPhases
import GHC.Hs
import SrcLoc
import Outputable
import Module
import PackageConfig
data HsComponentId = HsComponentId {
HsComponentId -> PackageName
hsPackageName :: PackageName,
HsComponentId -> ComponentId
hsComponentId :: ComponentId
}
instance Outputable HsComponentId where
ppr :: HsComponentId -> SDoc
ppr (HsComponentId PackageName
_pn ComponentId
cid) = ComponentId -> SDoc
forall a. Outputable a => a -> SDoc
ppr ComponentId
cid
data HsUnitId n = HsUnitId (Located n) [LHsModuleSubst n]
type LHsUnitId n = Located (HsUnitId n)
type HsModuleSubst n = (Located ModuleName, LHsModuleId n)
type LHsModuleSubst n = Located (HsModuleSubst n)
data HsModuleId n = HsModuleVar (Located ModuleName)
| HsModuleId (LHsUnitId n) (Located ModuleName)
type LHsModuleId n = Located (HsModuleId n)
data HsUnit n = HsUnit {
HsUnit n -> Located n
hsunitName :: Located n,
HsUnit n -> [LHsUnitDecl n]
hsunitBody :: [LHsUnitDecl n]
}
type LHsUnit n = Located (HsUnit n)
data HsUnitDecl n
= DeclD HscSource (Located ModuleName) (Maybe (Located (HsModule GhcPs)))
| IncludeD (IncludeDecl n)
type LHsUnitDecl n = Located (HsUnitDecl n)
data IncludeDecl n = IncludeDecl {
IncludeDecl n -> LHsUnitId n
idUnitId :: LHsUnitId n,
IncludeDecl n -> Maybe [LRenaming]
idModRenaming :: Maybe [ LRenaming ],
IncludeDecl n -> Bool
idSignatureInclude :: Bool
}
data Renaming = Renaming { Renaming -> Located ModuleName
renameFrom :: Located ModuleName
, Renaming -> Maybe (Located ModuleName)
renameTo :: Maybe (Located ModuleName) }
type LRenaming = Located Renaming