tools/PascalPreprocessor.hs
changeset 6891 ab9843957664
parent 6453 11c578d30bd3
child 6964 6dde80ae7049
equal deleted inserted replaced
6890:6fc12f30c55c 6891:ab9843957664
    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", "")]
    18 initDefines = Map.fromList [("FPC", ""), ("PAS2C", "")]
    19         
    19         
    20 preprocess :: String -> IO String
    20 preprocess :: String -> IO String
    21 preprocess fn = do
    21 preprocess fn = do
    22     r <- runParserT (preprocessFile fn) (initDefines, [True]) "" ""
    22     r <- runParserT (preprocessFile fn) (initDefines, [True]) "" ""
    23     case r of
    23     case r of