errata-0.3.0.0: Source code error pretty printing

Errata.Internal.Render

Description

Functions for rendering the errors. You should not need to import this, as these functions are lower-level.

This module is internal, and may break across non-breaking versions.

Synopsis

# Documentation

renderErrors :: Source source => source -> [Errata] -> Builder Source #

Renders a collection of Errata.

Arguments

 :: Source source => IntMap [source] The source table. -> Errata The Errata to render. -> [IntMap [Pointer]] The pointers of each block grouped by line. -> [Line] The mininum line of each block. -> [Line] The maxinum line of each block. -> Builder

Renders a single Errata.

Arguments

 :: Source source => IntMap [source] The source table. -> Block The block to render. -> IntMap [Pointer] The pointers of this block grouped by line. -> (Line, Line) The mininum and maximum lines of this block. -> Builder

Renders a single block.

Arguments

 :: forall source. Source source => [(Line, source)] The source lines, from the minimum line to the maximum line for the block. -> Block The block to render. -> Int The length of the actual number of the maximum line. -> IntMap [Pointer] The pointers of this block grouped by line. -> Maybe Builder

Renders the source lines for a block.

Group the pointers of a block by the line they appear on.

slices :: Monoid a => [a] -> [[a]] Source #

Turns a list into a list of tail slices of the original list, with each element at index i dropping the first i elements of the original list and tailing a mempty.

This allows for correct behavior on out-of-source-bounds pointers.

makeSourceTable :: Monoid a => Line -> Line -> [a] -> IntMap [a] Source #

Create a source table from the given line span and source lines.