"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 :: Options -> String -> IO [String]
|
||||||
check opt fileName = withGHC $ checkIt `gcatch` handleErrMsg
|
check opt fileName = withGHC' fileName $ checkIt `gcatch` handleErrMsg
|
||||||
where
|
where
|
||||||
checkIt = do
|
checkIt = do
|
||||||
(file,readLog) <- initializeGHC opt fileName options True
|
(file,readLog) <- initializeGHC opt fileName options True
|
||||||
|
@ -15,13 +15,16 @@ import Types
|
|||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
withGHC :: Alternative m => Ghc (m a) -> IO (m a)
|
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
|
dflags <- getSessionDynFlags
|
||||||
defaultCleanupHandler dflags body
|
defaultCleanupHandler dflags body
|
||||||
where
|
where
|
||||||
ignore :: Alternative m => SomeException -> IO (m a)
|
ignore :: Alternative m => SomeException -> IO (m a)
|
||||||
ignore e = do
|
ignore e = do
|
||||||
hPutStr stderr "Dummy:0:0:Error:"
|
hPutStr stderr $ file ++ ":0:0:Error:"
|
||||||
hPrint stderr e
|
hPrint stderr e
|
||||||
exitSuccess
|
exitSuccess
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user