X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fparser%2FParserCoreUtils.hs;h=8f67d962396d602506804e8cf5e3a8637af9e6b8;hp=e32038bf3b9aceb0d6fdacefac5bd135c5a161d4;hb=6f66d02c9654fc037db0582857acdcc15e0fd1d3;hpb=ad94d40948668032189ad22a0ad741ac1f645f50 diff --git a/compiler/parser/ParserCoreUtils.hs b/compiler/parser/ParserCoreUtils.hs index e32038b..8f67d96 100644 --- a/compiler/parser/ParserCoreUtils.hs +++ b/compiler/parser/ParserCoreUtils.hs @@ -1,13 +1,7 @@ -{-# OPTIONS -w #-} --- The above warning supression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/CodingStyle#Warnings --- for details - module ParserCoreUtils where -import IO +import Exception +import System.IO data ParseResult a = OkP a | FailP String type P a = String -> Int -> ParseResult a @@ -26,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)