tools/pas2c/PascalPreprocessor.hs
branchwebgl
changeset 9982 24ea101fdc7f
parent 9966 01e198990211
child 10015 4feced261c68
--- a/tools/pas2c/PascalPreprocessor.hs	Wed Jan 08 23:49:08 2014 +0100
+++ b/tools/pas2c/PascalPreprocessor.hs	Thu Jan 09 23:54:40 2014 +0400
@@ -17,19 +17,9 @@
         , (try $ string "//") >> manyTill anyChar (try newline) >> return "\n"
         ]
 
-
-initDefines = Map.fromList [
-    ("FPC", "")
-    , ("PAS2C", "")
-    , ("DEBUGFILE", "")
---    , ("WEBGL", "")
---    , ("AI_MAINTHREAD", "")
-    , ("ENDIAN_LITTLE", "")
-    ]
-
-preprocess :: String -> String -> String -> IO String
-preprocess inputPath alternateInputPath fn = do
-    r <- runParserT (preprocessFile (inputPath ++ fn)) (initDefines, [True]) "" ""
+preprocess :: String -> String -> String -> [String] -> IO String
+preprocess inputPath alternateInputPath fn symbols = do
+    r <- runParserT (preprocessFile (inputPath ++ fn)) (Map.fromList $ map (\s -> (s, "")) symbols, [True]) "" ""
     case r of
          (Left a) -> do
              hPutStrLn stderr (show a)