From 1ea1385dfe0b6024ac77a7af6e08474d289faa81 Mon Sep 17 00:00:00 2001 From: "davve@dtek.chalmers.se" Date: Thu, 5 Apr 2007 17:19:56 +0000 Subject: Do save/read of interface files properly --- src/Main.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index 264c1ec3..28723e71 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -308,6 +308,7 @@ startGHC libDir = do let flags'' = dopt_set flags' Opt_Haddock return (session, flags'') +-- TODO: clean up, restructure and make sure it handles cleanup sortAndCheckModules :: Session -> [FilePath] -> IO [CheckedMod] sortAndCheckModules session files = do parseStaticFlags [] -- to avoid a GHC bug @@ -428,10 +429,15 @@ run flags modules extEnv = do maybe_contents_url maybe_index_url copyHtmlBits odir libdir css_file + let iface = InterfaceFile { + ifDocEnv = homeEnv +-- ifModules = map hmod2interface visibleMods + } + case [str | Flag_DumpInterface str <- flags] of [] -> return () fs -> let filename = (last fs) in - writeInterfaceFile filename (InterfaceFile homeEnv) + writeInterfaceFile filename iface type CheckedMod = (Module, FilePath, FullyCheckedMod) @@ -1226,8 +1232,8 @@ getPackage :: Session -> InstalledPackageInfo -> IO PackageData getPackage session pkgInfo = do html <- getHtml pkgInfo iface <- getIface pkgInfo - InterfaceFile docEnv <- readInterfaceFile iface - + iface <- readInterfaceFile iface + let modules = packageModules pkgInfo -- try to get a ModuleInfo struct for each module @@ -1240,7 +1246,7 @@ getPackage session pkgInfo = do return $ PackageData { pdModules = modules, - pdDocEnv = docEnv, + pdDocEnv = ifDocEnv iface, pdHtmlPath = html } -- cgit v1.2.3