Commit d9283d29 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Rearrange the code a bit.

parent 7802fa05
......@@ -142,21 +142,6 @@ import System.Environment (getEnv)
import Distribution.Compat.Exception (catchExit, catchIO)
import Distribution.System (Platform, platformFromTriple)
getGhcInfo :: Verbosity -> ConfiguredProgram -> IO [(String, String)]
getGhcInfo verbosity ghcProg =
case programVersion ghcProg of
Just ghcVersion
| ghcVersion >= Version [6,7] [] ->
do xs <- getProgramOutput verbosity (suppressOverrideArgs ghcProg)
["--info"]
case reads xs of
[(i, ss)]
| all isSpace ss ->
return i
_ ->
die "Can't parse --info output of GHC"
_ ->
return []
-- -----------------------------------------------------------------------------
-- Configuring
......@@ -402,6 +387,22 @@ getLanguages _ ghcProg
where
Just ghcVersion = programVersion ghcProg
getGhcInfo :: Verbosity -> ConfiguredProgram -> IO [(String, String)]
getGhcInfo verbosity ghcProg =
case programVersion ghcProg of
Just ghcVersion
| ghcVersion >= Version [6,7] [] ->
do xs <- getProgramOutput verbosity (suppressOverrideArgs ghcProg)
["--info"]
case reads xs of
[(i, ss)]
| all isSpace ss ->
return i
_ ->
die "Can't parse --info output of GHC"
_ ->
return []
getExtensions :: Verbosity -> ConfiguredProgram -> IO [(Extension, Flag)]
getExtensions verbosity ghcProg
| ghcVersion >= Version [6,7] [] = do
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment