hindent-5.3.4: Extensible Haskell pretty printer

Safe HaskellSafe
LanguageHaskell2010

HIndent.CodeBlock

Synopsis

Documentation

data CodeBlock Source #

A block of code.

Constructors

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.