-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A liberalised re-implementation of cpp, the C pre-processor. -- -- Cpphs is a re-implementation of the C pre-processor that is both more -- compatible with Haskell, and itself written in Haskell so that it can -- be distributed with compilers. -- -- This version of the C pre-processor is pretty-much feature-complete -- and compatible with traditional (K&R) pre-processors. Additional -- features include: a plain-text mode; an option to unlit literate code -- files; and an option to turn off macro-expansion. @package cpphs @version 1.3 -- | Part of this code is from Report on the Programming Language -- Haskell, version 1.2, appendix C. module Language.Preprocessor.Unlit -- | unlit takes a filename (for error reports), and transforms the -- given string, to eliminate the literate comments from the program -- text. unlit :: FilePath -> String -> String -- | Include the interface that is exported module Language.Preprocessor.Cpphs runCpphs :: [CpphsOption] -> FilePath -> String -> IO String -- | Run a first pass of cpp, evaluating #ifdef's and processing -- #include's, whilst taking account of #define's and #undef's as we -- encounter them. cppIfdef :: FilePath -> [(String, String)] -> [String] -> Bool -> Bool -> String -> [(Posn, String)] -- | Walk through the document, replacing calls of macros with their -- expanded RHS. macroPass :: [(String, String)] -> Bool -> Bool -> Bool -> Bool -> [(Posn, String)] -> String data CpphsOption CpphsNoMacro :: CpphsOption CpphsNoLine :: CpphsOption CpphsText :: CpphsOption CpphsStrip :: CpphsOption CpphsAnsi :: CpphsOption CpphsLayout :: CpphsOption CpphsUnlit :: CpphsOption CpphsMacro :: (String, String) -> CpphsOption CpphsPath :: String -> CpphsOption parseOption :: String -> Maybe CpphsOption