tools/PascalPreprocessor.hs
changeset 7006 6af78154dc62
parent 6964 6dde80ae7049
child 7038 d853e4385241
--- a/tools/PascalPreprocessor.hs	Sun Apr 01 15:23:34 2012 +0200
+++ b/tools/PascalPreprocessor.hs	Wed May 02 23:53:45 2012 +0200
@@ -15,7 +15,7 @@
         , (try $ string "//") >> manyTill anyChar (try newline) >> return "\n"
         ]
 
-initDefines = Map.fromList [("FPC", "")]
+initDefines = Map.fromList [("FPC", ""), ("PAS2C", "")]
         
 preprocess :: String -> IO String
 preprocess fn = do
@@ -74,7 +74,7 @@
         char '"'
         spaces
         char '}'
-        f <- liftIO (readFile fn)
+        f <- liftIO (readFile fn `catch` error ("File not found: " ++ fn))
         c <- getInput
         setInput $ f ++ c
         return ""