New method to check Template Haskell.

This commit is contained in:
Kazu Yamamoto
2013-03-13 13:17:22 +09:00
parent 9e54c8c87b
commit 539fd305bd
6 changed files with 42 additions and 78 deletions

View File

@@ -1,6 +1,7 @@
module Check (checkSyntax) where
import Control.Applicative
import Control.Monad
import CoreMonad
import ErrMsg
import Exception
@@ -20,9 +21,11 @@ check :: Options -> Cradle -> String -> IO [String]
check opt cradle fileName = withGHC fileName $ checkIt `gcatch` handleErrMsg
where
checkIt = do
readLog <- initializeFlagsWithCradle opt cradle fileName options True
readLog <- initializeFlagsWithCradle opt cradle options True
setTargetFile fileName
_ <- load LoadAllTargets
slow <- needsTemplateHaskell <$> depanal [] False
when slow setSlowDynFlags
void $ load LoadAllTargets
liftIO readLog
options
| expandSplice opt = "-w:" : ghcOpts opt