X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fparser%2FParserCoreUtils.hs;h=8f67d962396d602506804e8cf5e3a8637af9e6b8;hb=e5d8b4d0c6dd20a51597517208cbd4b0cc50c7de;hp=124294bbb297abc3627d45b5a762873b7d22d3bc;hpb=de777ba42eb12b6a20e548a959b23b60179d9b57;p=ghc-hetmet.git 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)