tools/PascalPreprocessor.hs
branchwebgl
changeset 7957 497ec84e0c21
parent 7762 d2fd8040534f
child 7961 620331af6b9a
--- a/tools/PascalPreprocessor.hs	Sun Nov 04 02:13:25 2012 +0100
+++ b/tools/PascalPreprocessor.hs	Sun Nov 04 02:35:17 2012 +0100
@@ -22,9 +22,9 @@
     , ("S3D_DISABLED", "")
     ]
 
-preprocess :: String -> IO String
-preprocess fn = do
-    r <- runParserT (preprocessFile fn) (initDefines, [True]) "" ""
+preprocess :: String -> String -> IO String
+preprocess inputPath fn = do
+    r <- runParserT (preprocessFile (inputPath ++ fn)) (initDefines, [True]) "" ""
     case r of
          (Left a) -> do
              hPutStrLn stderr (show a)
@@ -79,7 +79,7 @@
         char '"'
         spaces
         char '}'
-        f <- liftIO (readFile fn `catch` error ("File not found: " ++ fn))
+        f <- liftIO (readFile (inputPath ++ fn) `catch` error ("File not found: " ++ fn))
         c <- getInput
         setInput $ f ++ c
         return ""