8e335fbc3b
- 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
31 lines
796 B
Haskell
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
|