"Dummy:0:0" -> "<filename>:0:0".
This commit is contained in:
parent
5189977cbc
commit
c7bd0d8863
2
Check.hs
2
Check.hs
@ -18,7 +18,7 @@ checkSyntax opt file = unlines <$> check opt file
|
||||
----------------------------------------------------------------
|
||||
|
||||
check :: Options -> String -> IO [String]
|
||||
check opt fileName = withGHC $ checkIt `gcatch` handleErrMsg
|
||||
check opt fileName = withGHC' fileName $ checkIt `gcatch` handleErrMsg
|
||||
where
|
||||
checkIt = do
|
||||
(file,readLog) <- initializeGHC opt fileName options True
|
||||
|
@ -15,13 +15,16 @@ import Types
|
||||
----------------------------------------------------------------
|
||||
|
||||
withGHC :: Alternative m => Ghc (m a) -> IO (m a)
|
||||
withGHC body = ghandle ignore $ runGhc (Just libdir) $ do
|
||||
withGHC = withGHC' "Dummy"
|
||||
|
||||
withGHC' :: Alternative m => FilePath -> Ghc (m a) -> IO (m a)
|
||||
withGHC' file body = ghandle ignore $ runGhc (Just libdir) $ do
|
||||
dflags <- getSessionDynFlags
|
||||
defaultCleanupHandler dflags body
|
||||
where
|
||||
ignore :: Alternative m => SomeException -> IO (m a)
|
||||
ignore e = do
|
||||
hPutStr stderr "Dummy:0:0:Error:"
|
||||
hPutStr stderr $ file ++ ":0:0:Error:"
|
||||
hPrint stderr e
|
||||
exitSuccess
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user