From a0e7455dfc08c06f19be0181c2db1daa6796d0ff Mon Sep 17 00:00:00 2001 From: davve Date: Sat, 16 Sep 2006 00:16:29 +0000 Subject: Comments only --- src/Main.hs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Main.hs b/src/Main.hs index cd406294..bea0dc5c 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -65,22 +65,38 @@ type CheckedMod = (Module, FullyCheckedMod, FilePath) main :: IO () main = do + + -- first, get the GHC library dir (-B option) args <- getArgs (libDir, rest) <- getLibDir args + + -- find out which flag mode we are in let (isGHCMode, rest') = parseModeFlag rest + + -- initialize GHC (session, dynflags) <- startGHC libDir + -- parse GHC flags given to the program (dynflags', rest'') <- if isGHCMode then parseGHCFlags_GHCMode dynflags rest' else parseGHCFlags_HaddockMode dynflags rest' + setSessionDynFlags session dynflags' + -- parse Haddock specific flags (flags, fileArgs) <- parseHaddockOpts rest'' - setSessionDynFlags session dynflags' + -- try to sort and check the input files using the GHC API modules <- sortAndCheckModules session dynflags' fileArgs + -- create a PackageData for each external package in the session + -- using the GHC API. The PackageData contains an html path, + -- a doc env and a list of module names. packages <- getPackages session dynflags' + + -- update the html references (module -> html file mapping) updateHTMLXRefs packages + + -- combine the doc envs of the external packages into one let env = packagesDocEnv packages -- TODO: continue to break up the run function into parts -- cgit v1.2.3