refactoring.

This commit is contained in:
Kazu Yamamoto 2014-04-10 16:41:05 +09:00
parent d6762ede6e
commit d6a81c0506

View File

@ -139,17 +139,20 @@ pretty dflag style = showOneLine dflag style . Gap.typeForUser
----------------------------------------------------------------
noWaringOptions :: [String]
noWaringOptions = ["-w:"]
inModuleContext :: Cmd -> Options -> Cradle -> FilePath -> ModuleString -> Ghc String -> String -> Ghc String
inModuleContext _ opt cradle file modstr action errmsg =
valid ||> invalid ||> return errmsg
where
valid = do
void $ initializeFlagsWithCradle opt cradle ["-w:"] False
void $ initializeFlagsWithCradle opt cradle noWaringOptions False
setTargetFiles [file]
void $ G.load LoadAllTargets
doif setContextFromTarget action
invalid = do
void $ initializeFlagsWithCradle opt cradle ["-w:"] False
void $ initializeFlagsWithCradle opt cradle noWaringOptions False
setTargetBuffer
void $ G.load LoadAllTargets
doif setContextFromTarget action