tools/PascalPreprocessor.hs
changeset 7038 d853e4385241
parent 6964 6dde80ae7049
child 7059 800dcaf979bf
equal deleted inserted replaced
7037:7edce323558f 7038:d853e4385241
    13         char '{' >> notFollowedBy (char '$') >> manyTill anyChar (try $ char '}') >> return ""
    13         char '{' >> notFollowedBy (char '$') >> manyTill anyChar (try $ char '}') >> return ""
    14         , (try $ string "(*") >> manyTill anyChar (try $ string "*)") >> return ""
    14         , (try $ string "(*") >> manyTill anyChar (try $ string "*)") >> return ""
    15         , (try $ string "//") >> manyTill anyChar (try newline) >> return "\n"
    15         , (try $ string "//") >> manyTill anyChar (try newline) >> return "\n"
    16         ]
    16         ]
    17 
    17 
    18 initDefines = Map.fromList [("FPC", ""), ("PAS2C", "")]
    18 initDefines = Map.fromList [
       
    19     ("FPC", "")
       
    20     , ("PAS2C", "")
       
    21     , ("USE_SDLTHREADS", "")
       
    22     ]
    19         
    23         
    20 preprocess :: String -> IO String
    24 preprocess :: String -> IO String
    21 preprocess fn = do
    25 preprocess fn = do
    22     r <- runParserT (preprocessFile fn) (initDefines, [True]) "" ""
    26     r <- runParserT (preprocessFile fn) (initDefines, [True]) "" ""
    23     case r of
    27     case r of