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
|
||||
|
||||
, getImports
|
||||
|
||||
) where
|
||||
|
||||
import System.Plugins.Make ( build )
|
||||
@ -629,6 +631,14 @@ loadDepends obj incpaths = do
|
||||
moduleDeps <- mapM (\(hi,m) -> loadObject m (Object hi)) mods''
|
||||
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
|
||||
--
|
||||
|
Loading…
x
Reference in New Issue
Block a user