Using GHC API.
This commit is contained in:
parent
40bdc70f8b
commit
1e87b386a1
11
Lang.hs
11
Lang.hs
@ -1,14 +1,7 @@
|
|||||||
module Lang where
|
module Lang where
|
||||||
|
|
||||||
import Control.Applicative
|
|
||||||
import Param
|
import Param
|
||||||
import System.IO
|
import DynFlags
|
||||||
import System.Process
|
|
||||||
|
|
||||||
listLanguages :: Options -> IO String
|
listLanguages :: Options -> IO String
|
||||||
listLanguages opt = convert opt . lines <$> getLangs opt
|
listLanguages opt = return $ convert opt supportedLanguages
|
||||||
|
|
||||||
getLangs :: Options -> IO String
|
|
||||||
getLangs opt = do
|
|
||||||
(_,hout,_,_) <- runInteractiveProcess (ghc opt) ["--supported-languages"] Nothing Nothing
|
|
||||||
hGetContents hout
|
|
||||||
|
@ -28,7 +28,7 @@ Executable ghc-mod
|
|||||||
GHC-Options: -Wall -fno-warn-unused-do-bind
|
GHC-Options: -Wall -fno-warn-unused-do-bind
|
||||||
else
|
else
|
||||||
GHC-Options: -Wall
|
GHC-Options: -Wall
|
||||||
Build-Depends: base >= 4.0 && < 5,
|
Build-Depends: base >= 4.0 && < 5, ghc,
|
||||||
parsec >= 3, process, haskell-src-exts,
|
parsec >= 3, process, haskell-src-exts,
|
||||||
directory, filepath
|
directory, filepath
|
||||||
Source-Repository head
|
Source-Repository head
|
||||||
|
Loading…
Reference in New Issue
Block a user