new include scheme.

This commit is contained in:
Kazu Yamamoto
2011-05-24 16:00:47 +09:00
parent 8bb0c27b0b
commit 783e4a4e4c
4 changed files with 34 additions and 24 deletions

View File

@@ -71,12 +71,12 @@ inModuleContext :: FilePath -> ModuleString -> Ghc String -> IO String
inModuleContext fileName modstr action = withGHC valid
where
valid = do
initSession ["-w"]
initSession ["-w"] Nothing
setTargetFile fileName
loadWithLogger (\_ -> return ()) LoadAllTargets
mif setContextFromTarget action invalid
invalid = do
initSession ["-w"]
initSession ["-w"] Nothing
setTargetBuffer
loadWithLogger defaultWarnErrLogger LoadAllTargets
mif setContextFromTarget action (return errorMessage)