| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Hpp
Description
Front-end interface to the pre-processor.
- parseDefinition :: ByteString -> ByteString -> Maybe (ByteString, Macro)
- preprocess :: Monad m => [ByteString] -> HppT m ()
- data HppState
- emptyHppState :: HppState
- initHppState :: Config -> Env -> HppState
- addDefinition :: ByteString -> ByteString -> HppState -> Maybe HppState
- runHpp :: MonadIO m => HppState -> HppT m a -> ExceptT Error m (HppOutput, HppState)
- streamHpp :: MonadIO m => HppState -> ([ByteString] -> m ()) -> HppT m a -> ExceptT Error m ([FilePath], HppState)
- data HppT m a
- data HppOutput = HppOutput {
- hppFilesRead :: [FilePath]
- hppOutput :: [ByteString]
Documentation
parseDefinition :: ByteString -> ByteString -> Maybe (ByteString, Macro) Source #
Lower level parsing of macro definitions. Will typically be used
with insertPair for manual construction of a Env binding
environment.
preprocess :: Monad m => [ByteString] -> HppT m () Source #
Preprocess lines of input.
Dynamic state of the preprocessor engine.
addDefinition :: ByteString -> ByteString -> HppState -> Maybe HppState Source #
addDefinition name expression adds a binding of name to
expression in the preprocessor’s internal state.
runHpp :: MonadIO m => HppState -> HppT m a -> ExceptT Error m (HppOutput, HppState) Source #
Run a preprocessor action with some initial state. Returns the result of preprocessing as well as an updated preprocessor state representation.
streamHpp :: MonadIO m => HppState -> ([ByteString] -> m ()) -> HppT m a -> ExceptT Error m ([FilePath], HppState) Source #
streamHpp state sink action runs a preprocessor action with
some initial state. Output is streamed to the caller-provided
output sink as it is generated. The list of files read during
preprocessing is returned along with an updated preprocessor state
representation.
The type of preprocessor actions. Created with preprocess and
executed with runHpp or streamHpp.
The result of running hpp
Constructors
| HppOutput | |
Fields
| |