--- 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 ""