Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Hpp.Config
Description
Preprocessor Configuration
- newtype TimeString = TimeString {}
- newtype DateString = DateString {}
- data ConfigF f = Config {
- curFileNameF :: f FilePath
- includePathsF :: f [FilePath]
- spliceLongLinesF :: f Bool
- eraseCCommentsF :: f Bool
- inhibitLinemarkersF :: f Bool
- replaceTrigraphsF :: f Bool
- prepDateF :: f DateString
- prepTimeF :: f TimeString
- type Config = ConfigF Identity
- realizeConfig :: ConfigF Maybe -> Maybe Config
- curFileName :: Config -> FilePath
- includePaths :: Config -> [FilePath]
- spliceLongLines :: Config -> Bool
- eraseCComments :: Config -> Bool
- inhibitLinemarkers :: Config -> Bool
- replaceTrigraphs :: Config -> Bool
- prepDate :: Config -> DateString
- prepTime :: Config -> TimeString
- defaultConfigF :: ConfigF Maybe
- formatPrepDate :: UTCTime -> DateString
- formatPrepTime :: UTCTime -> TimeString
- defaultConfigFNow :: IO (ConfigF Maybe)
Documentation
Pre-processor configuration parameterized over a functor. This is
used to normalize partial configurations, ConfigF Maybe
, and
configurations suitable for the pre-processor logic, ConfigF
Identity
. Specifically, the source file name of the file being
processed must be set.
Constructors
Config | |
Fields
|
realizeConfig :: ConfigF Maybe -> Maybe Config Source #
Ensure that required configuration fields are supplied.
curFileName :: Config -> FilePath Source #
Extract the current file name from a configuration.
includePaths :: Config -> [FilePath] Source #
Extract the include paths name from a configuration.
spliceLongLines :: Config -> Bool Source #
Determine if continued long lines should be spliced.
eraseCComments :: Config -> Bool Source #
Determine if C-style comments should be erased.
inhibitLinemarkers :: Config -> Bool Source #
Determine if generation of linemarkers should be inhibited.
replaceTrigraphs :: Config -> Bool Source #
Determine if trigraph sequences should be replaced.
prepDate :: Config -> DateString Source #
The date the pre-processor was run on.
prepTime :: Config -> TimeString Source #
The time of the active pre-processor invocation.
defaultConfigF :: ConfigF Maybe Source #
A default configuration with no current file name set.
formatPrepDate :: UTCTime -> DateString Source #
Format a date according to the C spec.
formatPrepTime :: UTCTime -> TimeString Source #
Format a time according to the C spec.