X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fparser%2FParserCoreUtils.hs;h=8f67d962396d602506804e8cf5e3a8637af9e6b8;hp=124294bbb297abc3627d45b5a762873b7d22d3bc;hb=6f66d02c9654fc037db0582857acdcc15e0fd1d3;hpb=de777ba42eb12b6a20e548a959b23b60179d9b57 diff --git a/compiler/parser/ParserCoreUtils.hs b/compiler/parser/ParserCoreUtils.hs index 124294b..8f67d96 100644 --- a/compiler/parser/ParserCoreUtils.hs +++ b/compiler/parser/ParserCoreUtils.hs @@ -1,6 +1,7 @@ module ParserCoreUtils where -import IO +import Exception +import System.IO data ParseResult a = OkP a | FailP String type P a = String -> Int -> ParseResult a @@ -19,7 +20,7 @@ failP s s' _ = FailP (s ++ ":" ++ s') getCoreModuleName :: FilePath -> IO String getCoreModuleName fpath = - catch (do + catchIO (do h <- openFile fpath ReadMode ls <- hGetContents h let mo = findMod (words ls)