-- 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.6 -- | 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 :: CpphsOptions -> FilePath -> String -> 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] -> BoolOptions -> String -> [(Posn, String)] -- | Walk through the document, replacing calls of macros with the expanded -- RHS. macroPass :: [(String, String)] -> BoolOptions -> [(Posn, String)] -> String -- | Cpphs options structure. data CpphsOptions CpphsOptions :: [FilePath] -> [FilePath] -> [(String, String)] -> [String] -> [FilePath] -> BoolOptions -> CpphsOptions infiles :: CpphsOptions -> [FilePath] outfiles :: CpphsOptions -> [FilePath] defines :: CpphsOptions -> [(String, String)] includes :: CpphsOptions -> [String] -- | Files to #include before anything else preInclude :: CpphsOptions -> [FilePath] boolopts :: CpphsOptions -> BoolOptions -- | Options representable as Booleans. data BoolOptions BoolOptions :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> BoolOptions -- | Leave #define and #undef in output of ifdef? macros :: BoolOptions -> Bool -- | Place #line droppings in output? locations :: BoolOptions -> Bool -- | Keep #pragma in final output? pragma :: BoolOptions -> Bool -- | Remove C eol (//) comments everywhere? stripEol :: BoolOptions -> Bool -- | Remove C inline (/**/) comments everywhere? stripC89 :: BoolOptions -> Bool -- | Lex input as Haskell code? lang :: BoolOptions -> Bool -- | Permit stringise # and catenate ## operators? ansi :: BoolOptions -> Bool -- | Retain newlines in macro expansions? layout :: BoolOptions -> Bool -- | Remove literate markup? literate :: BoolOptions -> Bool -- | Issue warnings? warnings :: BoolOptions -> Bool -- | Parse all command-line options. parseOptions :: [String] -> Either String CpphsOptions -- | Default options. defaultCpphsOptions :: CpphsOptions -- | Default settings of boolean options. defaultBoolOptions :: BoolOptions