Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Hpp.RunHpp
Description
Mid-level interface to the pre-processor.
Synopsis
- preprocess :: (Monad m, HasHppState m, HasError m, HasEnv m) => [String] -> HppT [String] (Parser m [TOKEN]) ()
- runHpp :: forall m a src. (MonadIO m, HasHppState m) => (FilePath -> m src) -> (src -> m ()) -> HppT src m a -> m (Either (FilePath, Error) (HppResult a))
- expandHpp :: forall m a src. (Monad m, HasHppState m, Monoid src) => (src -> m ()) -> HppT src m a -> m (Either (FilePath, Error) (HppResult a))
- hppIOSink :: Config -> Env -> ([String] -> IO ()) -> [String] -> IO [FilePath]
- hppIO :: Config -> Env -> FilePath -> [String] -> IO (Either Error ([FilePath], [String]))
- data HppResult a = HppResult {
- hppFilesRead :: [FilePath]
- hppResult :: a
Documentation
preprocess :: (Monad m, HasHppState m, HasError m, HasEnv m) => [String] -> HppT [String] (Parser m [TOKEN]) () Source #
Run a stream of lines through the preprocessor.
runHpp :: forall m a src. (MonadIO m, HasHppState m) => (FilePath -> m src) -> (src -> m ()) -> HppT src m a -> m (Either (FilePath, Error) (HppResult a)) Source #
Interpret the IO components of the preprocessor. This implementation relies on IO for the purpose of checking search paths for included files.
expandHpp :: forall m a src. (Monad m, HasHppState m, Monoid src) => (src -> m ()) -> HppT src m a -> m (Either (FilePath, Error) (HppResult a)) Source #
Like ’runHpp’, but any #include
directives are skipped. These
ignored inclusions are tracked in the returned list of files, but
note that since extra source files are not opened, any files they
might wish to include are not discovered.
hppIOSink :: Config -> Env -> ([String] -> IO ()) -> [String] -> IO [FilePath] Source #
General hpp runner against input source file lines. Output lines
are fed to the caller-supplied sink function. Any errors
encountered are thrown with error
.