Allow building with modern 'base' package webgl
authorunc0rr
Sat, 15 Jun 2013 23:44:37 +0400
branchwebgl
changeset 9164 d923ba9d1145
parent 9162 2c6ad606f4fb
child 9166 3774ac58e65e
Allow building with modern 'base' package
tools/pas2c/PascalPreprocessor.hs
--- a/tools/pas2c/PascalPreprocessor.hs	Sun Jun 09 12:28:11 2013 +0200
+++ b/tools/pas2c/PascalPreprocessor.hs	Sat Jun 15 23:44:37 2013 +0400
@@ -1,3 +1,4 @@
+{-# LANGUAGE ScopedTypeVariables #-}
 module PascalPreprocessor where
 
 import Text.Parsec
@@ -5,6 +6,7 @@
 import Control.Monad
 import System.IO
 import qualified Data.Map as Map
+import Control.Exception(catch, IOException)
 import Data.Char
 
 
@@ -81,7 +83,7 @@
         char '"'
         spaces
         char '}'
-        f <- liftIO (readFile (inputPath ++ fn) `catch` (\exc -> readFile (alternateInputPath ++ fn) `catch` error ("File not found: " ++ fn)))
+        f <- liftIO (readFile (inputPath ++ fn) `catch` (\(exc :: IOException) -> readFile (alternateInputPath ++ fn) `catch` (\(_ :: IOException) -> error ("File not found: " ++ fn))))
         c <- getInput
         setInput $ f ++ c
         return ""