X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fparser%2FParserCoreUtils.hs;h=8f67d962396d602506804e8cf5e3a8637af9e6b8;hp=3c440b60b6fbce442353a819ed64f7276e88fc82;hb=6f66d02c9654fc037db0582857acdcc15e0fd1d3;hpb=7fc749a43b4b6b85d234fa95d4928648259584f4 diff --git a/compiler/parser/ParserCoreUtils.hs b/compiler/parser/ParserCoreUtils.hs index 3c440b6..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/Commentary/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)