ghc-mod/Check.hs
ihameed 8e335fbc3b GHC 7.6.1 compatibility
- switch from ClockTime to UTCTime in Info.pprInfo
- make ghc-mod loggers always take a first argument of type DynFlags
- consolidate GHC API shims in Gap.hs--this depends on tracingDynFlags,
which is unfortunate
2012-10-16 03:27:35 -07:00

31 lines
796 B
Haskell

module Check (checkSyntax) where
import Cabal
import Control.Applicative
import CoreMonad
import ErrMsg
import Exception
import GHC
import GHCApi
import Prelude
import Types
----------------------------------------------------------------
checkSyntax :: Options -> String -> IO String
checkSyntax opt file = unlines <$> check opt file
----------------------------------------------------------------
check :: Options -> String -> IO [String]
check opt fileName = withGHC $ checkIt `gcatch` handleErrMsg
where
checkIt = do
(file,readLog) <- initializeGHC opt fileName options True
setTargetFile file
_ <- load LoadAllTargets
liftIO readLog
options
| expandSplice opt = ["-w:"] ++ ghcOpts opt
| otherwise = ["-Wall"] ++ ghcOpts opt