# HG changeset patch # User unc0rr # Date 1371325477 -14400 # Node ID d923ba9d114519266f9b73f411a10ae2aacbfde2 # Parent 2c6ad606f4fb20c583262855bf7ccccb69c4fb27 Allow building with modern 'base' package diff -r 2c6ad606f4fb -r d923ba9d1145 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 ""