Add getImports, a useful interface to the .hi file parser
This commit is contained in:
parent
62b6e31734
commit
20e08f523a
@ -46,6 +46,8 @@ module System.Plugins.Load (
|
|||||||
|
|
||||||
, Symbol
|
, Symbol
|
||||||
|
|
||||||
|
, getImports
|
||||||
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import System.Plugins.Make ( build )
|
import System.Plugins.Make ( build )
|
||||||
@ -629,6 +631,14 @@ loadDepends obj incpaths = do
|
|||||||
moduleDeps <- mapM (\(hi,m) -> loadObject m (Object hi)) mods''
|
moduleDeps <- mapM (\(hi,m) -> loadObject m (Object hi)) mods''
|
||||||
return (hiface,moduleDeps)
|
return (hiface,moduleDeps)
|
||||||
|
|
||||||
|
-- ---------------------------------------------------------------------
|
||||||
|
-- Nice interface to .hi parser
|
||||||
|
--
|
||||||
|
getImports :: String -> IO [String]
|
||||||
|
getImports m = do
|
||||||
|
hi <- readIface (m ++ hiSuf)
|
||||||
|
return $ dep_mods (mi_deps hi)
|
||||||
|
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- C interface
|
-- C interface
|
||||||
--
|
--
|
||||||
|
Loading…
x
Reference in New Issue
Block a user