Îõ³h&<:,Ù      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX(c) 2020- compMITonecomputer00@gmail.comstableportable Safe-Inferred!À†errata4A class for manipulating and converting source text.For  ByteStringã source types, you should convert it to one of the built-in instances with your encoding of choice.errataÇThe empty source, used when a pointer references an out-of-bounds line.errataSplits the source into lines.errataConverts the source text to À (strict). The given source text is a single line of the source.(c) 2020- compMITonecomputer00@gmail.comstableportable Safe-Inferred!$%G0errataÆStylization options for an individual pointer, e.g. characters to use. errata2Stylize the text that this pointer is underlining.This is only used if 1 uses the given pointer styles, for example with Õ. The result of this should visually take up the same space as the original text. errata/The text to underline a character in a pointer.&This should visually be one character. errataëThe text to use as a connector upwards and hooking to the right for the label of a pointer that drops down.*This probably looks best as one character. errataÙThe text to use as a vertical bar when connecting a pointer that drops down to its label.&This should visually be one character. errataêWhether to use the hook for labels that drop down, or simply start the label directly under the connector.errata8Stylization options for a block, e.g. characters to use.errata:Shows the location of a block at a file, line, and column.8This is put on its own line just above the source lines.errataShows the line number n for a source line.6The result should visually be the same length as just show n.errataStylize a source line.ŠThe style and the column span (sorted, starting at 1) of the text that is being underlined are given for highlighting purposes (see ¥). They can be ignored for source code highlighting instead, for example. The result of this should visually take up the same space as the original line.errataÚThe text to use as an ellipsis in the position of line numbers for when lines are omitted.&This should visually be one character.errata#The prefix before the source lines.?Before it may be the line number, and after it the source line.errata;The text to use as a vertical bar when connecting pointers.&This should visually be one character.errata=The text to use as a horizontal bar when connecting pointers.&This should visually be one character.errataÑThe text to use as a connector downwards and rightwards when connecting pointers.&This should visually be one character.errataÏThe text to use as a connector upwards and rightwards when connecting pointers.&This should visually be one character.errataÛThe text to use as a connector upwards, downwards, and rightwards when connecting pointers.&This should visually be one character.errata6The number of spaces a tab character is equivalent to.:Your source will have tabs replaced with this many spaces.errataëMaximum number of extra lines that can be added after the first line when skipping lines between two lines.errataíMaximum number of extra lines that can be added before the second line when skipping lines between two lines.errata;Whether to add a padding line before the first source line.errata9Whether to add a padding line after the last source line.errata3Whether to enable decorations at all in this block.,This includes the pointer connectors (as in :) and the underlines, connectors, and labels (as in /). However, highlighting will still be applied. errata"Whether to enable the line prefix.!erratañA pointer is the span of the source code at a line, from one column to another. Each of the positions start at 1.9A pointer may also have a label that will display inline.ÐA pointer may also be connected to all the other pointers within the same block.#errataThe line of the pointer.$errata#The starting column of the pointer.%errata!The ending column of the pointer.&errata2Whether this pointer connects with other pointers.'errata"An optional label for the pointer.(errataA style for this pointer.)errataÌInformation about a block in the source code, such as pointers and messages.*Each block has a style associated with it.+errataThe style of the block.,errata>The filepath, line, and column of the block. These start at 1.:This is used to create the text that details the location.-errata!The header message for the block.?This will appear below the location and above the source lines..errataÛThe block's pointers. These are used to "point out" parts of the source code in this block.‹The locations of each of these pointers must be non-overlapping. If the pointers are touching at a boundary however, that is allowed./errataThe body message for the block.(This will appear below the source lines.0errata9A collection of information for pretty printing an error.2errata.The message that appears above all the blocks.3errata%Blocks in the source code to display.4errata.The message that appears below all the blocks.5errata.Label text. Generally goes inline with things.6errata'Body text. Generally goes below things.7errata)Header text. Generally goes above things.8errata-Column number, starts at 1, increments every Y.9errata>Line number, starts at 1, increments every new line character.:errataGets the column span for a !.;errata*Gets physical information about a pointer.5  !"#$%&'()*+,-./0123456789:;59876501234)*+,-./!"#$%&'(:;  (c) 2020- compMITonecomputer00@gmail.comstableportable Safe-Inferred!Á Aerrata*A basic style using only ASCII characters.!Errors should look like so (with B): ûerror header message --> file.ext:1:16 block header message | 1 | line 1 foo bar do | ________________^^ start label 2 | | line 2 | | ^ unconnected label 3 | | line 3 | |______^ middle label 4 | | line 4 5 | | line 5 . | | 7 | | line 7 8 | | line 8 baz end | |______^_____^^^ end label | | | | inner label block body message error body messageBerrata%Pointers using only ASCII characters.Cerrata'A fancy style using Unicode characters.!Errors should look like so (with D): Óerror header message ’C file.ext:1:16 block header message ‚J 1 ‚J line 1 foo bar do ‚J ŒJ€J€J€J€J€J€J€J€J€J€J€J€J€J€J€J€J^^ start label 2 ‚J ‚J line 2 ‚J ‚J ^ unconnected label 3 ‚J ‚J line 3 ‚J œJ€J€J€J€J€J€J^ middle label 4 ‚J ‚J line 4 5 ‚J ‚J line 5 . ‚J ‚J 7 ‚J ‚J line 7 8 ‚J ‚J line 8 baz end ‚J ”J€J€J€J€J€J€J^€J€J€J€J€J^^^ end label ‚J ‚J ‚J ”J inner labelDerrata2Pointers using Unicode characters and ANSI colors.EerrataÃA fancy style using Unicode characters and ANSI colors, similar to C. Most things are colored red.Ferrata6Red pointers using Unicode characters and ANSI colors.GerrataÃA fancy style using Unicode characters and ANSI colors, similar to C!. Most things are colored yellow.Herrata9Yellow pointers using Unicode characters and ANSI colors.IerrataÕAdds highlighting to spans of text by modifying it with the given styles' highlights.IerrataÖStyles and columns to work on. These are sorted, starting at 1. They must not overlap.errataText to highlight. ABCDEFGHI ABCDEFGHI(c) 2020- compMITonecomputer00@gmail.comstableportable Safe-Inferred !$%&'Ûã)wJerrataRenders a collection of 0.Kerrata9Group the pointers of a block by the line they appear on.LerrataÀCreate a source table from the given line span and source lines.MerrataÙ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 an .ÂThis allows for correct behavior on out-of-source-bounds pointers.NerrataRenders a single 0.OerrataRenders a single block.Perrata%Renders the source lines for a block.Zerrata-Makes a line of decorations below the source.[errata0Paramorphism on lists (strictly, from the left).\errataÀCompares length of two lists without traversing them completely.]errataPuts text between each item.^errataReplicates text into a builder._errataîReplaces each character in the text with the appropriate instances of the given text based on character width.ÍThe result will also be right-padded with the given text to the given length.ÐFor tabs, the tab width given is used to make it equivalent to that many spaces.`errataÙGet the designated render width of a character: 0 for a combining character, 1 for a regular character, 2 for a wide character. (Wide characters are rendered as exactly double width in apps and fonts that support it.)(From Pandoc.)NerrataThe source table.errataThe 0 to render.errata+The pointers of each block grouped by line.errataThe mininum line of each block.errataThe maxinum line of each block.OerrataThe source table.errataThe block to render.errata+The pointers of this block grouped by line.errata,The mininum and maximum lines of this block.PerrataÊThe source lines, from the minimum line to the maximum line for the block.errataThe block to render.errata4The length of the actual number of the maximum line.errata+The pointers of this block grouped by line.Zerrata3Catch up from the previous pointer to this pointer.&catchUp distance isFirst pointers text' should return text of at least length distance.errata8Add text underneath the pointer before the next pointer.(underlinePointer pointerLen pointer text' should return the text and its length.JKLMNOPJNOPKML(c) 2020- compMITonecomputer00@gmail.comstableportable Safe-Inferred9¼QerrataÐCreates a simple error that has a single block, with an optional header or body.RerrataàA simple block that points to only one line and optionally has a label, header, or body message.Serrata A variant of R that only points at one column.TerrataÔA block that points to two parts of the source that are visually connected together.Uerrata A variant of T- where the pointers point at only one column.VerrataÔA block that points to two parts of the source that are visually connected together.ßIf the two parts of the source happen to be on the same line, the pointers are merged into one.Werrata A variant of V- where the pointers point at only one column.Xerrata?Pretty prints errors. The original source is required. Returns  ; (lazy). If the list is empty, an empty string is returned.%Suppose we had an error of this type: ±data ParseError = ParseError { peFile :: FilePath , peLine :: Int , peCol :: Int , peUnexpected :: T.Text , peExpected :: [T.Text] }3Then we can create a simple pretty printer like so: Úimport qualified Data.Text as T import qualified Data.Text.Lazy.IO as TL import Errata toErrata :: ParseError -> 08 toErrata (ParseError fp l c unexpected expected) = Q- (Just "an error occured!") (R    ´ fp (Just "error: invalid syntax") (l, c, c + T.length unexpected, Just "this one") (Just $ "unexpected " <> unexpected <> "\nexpected " <> T.intercalate ", " expected)) Nothing printErrors :: T.Text -> [ParseError] -> IO () printErrors source es = TL.putStrLn $ X source (map toErrata es) (Note that in the above example, we have OverloadedStrings enabled to reduce uses of  .,An example error message from this might be: ³an error occured! --> ./comma.json:2:18 error: invalid syntax | 2 | "bad": [1, 2,] | ^ this one unexpected ] expected null, true, false, ", -, digit, [, {Qerrata The header.errata The block.errata The body.RerrataThe style of the block.errataThe style of the pointer.errata The filepath.errataThe header message.errataThe second line number and column, starting at 1, and a label.errataThe body message.VerrataThe style of the block.errataThe style of the pointer.errata The filepath.errataThe header message.errataÂThe first line number and column span, starting at 1, and a label.errataÃThe second line number and column span, starting at 1, and a label.errata8The label for when the two pointers are merged into one.errataThe body message.WerrataThe style of the block.errataThe style of the pointer.errata The filepath.errataThe header message.errata=The first line number and column, starting at 1, and a label.errata>The second line number and column, starting at 1, and a label.errata8The label for when the two pointers are merged into one.errataThe body message.6  !"#$%&'()*+,-./01234QRSTUVWX601234Q)*+,-./RSTUVW!"#$%&'(  Xá  !"#$%&'()*+,,-./01233456789:;<=>?@ABCDEFG  HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefçerrata-0.4.0.0-inplace Errata.Source Errata.Types Errata.StylesErrata.Internal.RenderErrata Data.TextText highlightData.Text.Lazy basicStyle basicPointerpackSource emptySource sourceToLines sourceToText $fSourceText $fSourceText0 $fSource[] PointerStylestyleHighlightstyleUnderline styleHookstyleConnectorstyleEnableHookStyle styleLocation styleNumber styleLine styleEllipsisstyleLinePrefix styleVerticalstyleHorizontalstyleDownRight styleUpRightstyleUpDownRight styleTabWidthstyleExtraLinesAfterstyleExtraLinesBeforestylePaddingTopstylePaddingBottomstyleEnableDecorationsstyleEnableLinePrefixPointer pointerLinepointerColStart pointerColEndpointerConnect pointerLabel pointerStyleBlock blockStyle blockLocation blockHeader blockPointers blockBody errataHeader errataBlocks errataBodyLabelBodyHeaderColumnLinepointerColumns pointerData$fShowPointerStyle $fShowStyle $fShowErrata $fShowBlock $fShowPointer fancyStyle fancyPointer fancyRedStylefancyRedPointerfancyYellowStylefancyYellowPointer renderErrorsgroupBlockPointersmakeSourceTableslices renderErrata renderBlockrenderSourceLines errataSimple blockSimple blockSimple'blockConnectedblockConnected' blockMerged blockMerged' prettyErrorsghc-prim GHC.TypesCharfoldDecorationsparal compareLengthunsplit replicateBreplaceWithWidth charWidth