Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Synopsis
Documentation
A block of code.
Shebang ByteString | |
HaskellSource Int ByteString | Includes the starting line (indexed from 0) for error reporting |
CPPDirectives ByteString |
cppSplitBlocks :: ByteString -> [CodeBlock] Source #
Break a Haskell code string into chunks, using CPP as a delimiter. Lines that start with '#if', '#end', or '#else' are their own chunks, and also act as chunk separators. For example, the code
#ifdef X x = X y = Y #else x = Y y = X #endif
will become five blocks, one for each CPP line and one for each pair of declarations.