From 1e87b386a19d19a1d00cac019fc82558133ae7f3 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Tue, 27 Apr 2010 10:29:29 +0900 Subject: [PATCH] Using GHC API. --- Lang.hs | 11 ++--------- ghc-mod.cabal | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Lang.hs b/Lang.hs index 423f6c9..7627ef6 100644 --- a/Lang.hs +++ b/Lang.hs @@ -1,14 +1,7 @@ module Lang where -import Control.Applicative import Param -import System.IO -import System.Process +import DynFlags listLanguages :: Options -> IO String -listLanguages opt = convert opt . lines <$> getLangs opt - -getLangs :: Options -> IO String -getLangs opt = do - (_,hout,_,_) <- runInteractiveProcess (ghc opt) ["--supported-languages"] Nothing Nothing - hGetContents hout +listLanguages opt = return $ convert opt supportedLanguages diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 1c70355..59d4178 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -28,7 +28,7 @@ Executable ghc-mod GHC-Options: -Wall -fno-warn-unused-do-bind else GHC-Options: -Wall - Build-Depends: base >= 4.0 && < 5, + Build-Depends: base >= 4.0 && < 5, ghc, parsec >= 3, process, haskell-src-exts, directory, filepath Source-Repository head