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 :: Cmd -> Options -> Cradle -> FilePath -> ModuleString -> Ghc String -> String -> Ghc String
inModuleContext _ opt cradle file modstr action errmsg = inModuleContext _ opt cradle file modstr action errmsg =
valid ||> invalid ||> return errmsg valid ||> invalid ||> return errmsg
where where
valid = do valid = do
void $ initializeFlagsWithCradle opt cradle ["-w:"] False void $ initializeFlagsWithCradle opt cradle noWaringOptions False
setTargetFiles [file] setTargetFiles [file]
void $ G.load LoadAllTargets void $ G.load LoadAllTargets
doif setContextFromTarget action doif setContextFromTarget action
invalid = do invalid = do
void $ initializeFlagsWithCradle opt cradle ["-w:"] False void $ initializeFlagsWithCradle opt cradle noWaringOptions False
setTargetBuffer setTargetBuffer
void $ G.load LoadAllTargets void $ G.load LoadAllTargets
doif setContextFromTarget action doif setContextFromTarget action