Îõ³h,7½5²Ù      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX0.4.0.3(c) 2020- compMITonecomputer00@gmail.comstableportable Safe-Inferred"ÃÅo4A 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.ÇThe empty source, used when a pointer references an out-of-bounds line.Splits the source into lines.Converts the source text to À (strict). The given source text is a single line of the source.(c) 2020- compMITonecomputer00@gmail.comstableportable Safe-Inferred"%&±0ÆStylization options for an individual pointer, e.g. characters to use. êWhether to use the hook for labels that drop down, or simply start the label directly under the connector. ÙThe text to use as a vertical bar when connecting a pointer that drops down to its label.&This should visually be one character. ë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. /The text to underline a character in a pointer.&This should visually be one character. 2Stylize 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.8Stylization options for a block, e.g. characters to use."Whether to enable the line prefix.3Whether 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.9Whether to add a padding line after the last source line.;Whether to add a padding line before the first source line.íMaximum number of extra lines that can be added before the second line when skipping lines between two lines.ëMaximum number of extra lines that can be added after the first line when skipping lines between two lines.6The number of spaces a tab character is equivalent to.:Your source will have tabs replaced with this many spaces.ÛThe text to use as a connector upwards, downwards, and rightwards when connecting pointers.&This should visually be one character.ÏThe text to use as a connector upwards and rightwards when connecting pointers.&This should visually be one character.ÑThe text to use as a connector downwards and rightwards when connecting pointers.&This should visually be one character.=The text to use as a horizontal bar when connecting pointers.&This should visually be one character.;The text to use as a vertical bar when connecting pointers.&This should visually be one character.#The prefix before the source lines.?Before it may be the line number, and after it the source line.ÚThe text to use as an ellipsis in the position of line numbers for when lines are omitted.&This should visually be one character.Stylize 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.Shows the line number n for a source line.6The result should visually be the same length as just show n. :Shows the location of a block at a file, line, and column.8This is put on its own line just above the source lines.!ñ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.#A style for this pointer.$"An optional label for the pointer.%2Whether this pointer connects with other pointers.&!The ending column of the pointer.'#The starting column of the pointer.(The line of the pointer.)ÌInformation about a block in the source code, such as pointers and messages.*Each block has a style associated with it.+The body message for the block.(This will appear below the source lines.,Û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.-!The header message for the block.?This will appear below the location and above the source lines..>The filepath, line, and column of the block. These start at 1.:This is used to create the text that details the location./The style of the block.09A collection of information for pretty printing an error.2.The message that appears below all the blocks.3%Blocks in the source code to display.4.The message that appears above all the blocks.5.Label text. Generally goes inline with things.6'Body text. Generally goes below things.7)Header text. Generally goes above things.8-Column number, starts at 1, increments every Y.9>Line number, starts at 1, increments every new line character.:Gets the column span for a !.;*Gets physical information about a pointer.5:;)*+-.,/6801324759!"&'%$(#  59876501432)*/.-,+!"('&%$#:;  (c) 2020- compMITonecomputer00@gmail.comstableportable Safe-Inferred"Ô A*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 messageB%Pointers using only ASCII characters.C'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 labelD2Pointers using Unicode characters and ANSI colors.EÃA fancy style using Unicode characters and ANSI colors, similar to C. Most things are colored red.F6Red pointers using Unicode characters and ANSI colors.GÃA fancy style using Unicode characters and ANSI colors, similar to C!. Most things are colored yellow.H9Yellow pointers using Unicode characters and ANSI colors.IÕAdds highlighting to spans of text by modifying it with the given styles' highlights.IÖStyles and columns to work on. These are sorted, starting at 1. They must not overlap.Text to highlight. BADFECHGI ABCDEFGHI(c) 2020- compMITonecomputer00@gmail.comstableportable Safe-Inferred "%&'(Þæ&£JRenders a collection of 0.K9Group the pointers of a block by the line they appear on.LÀCreate a source table from the given line span and source lines.MÙ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.NRenders a single 0.ORenders a single block.P%Renders the source lines for a block.Z-Makes a line of decorations below the source.[0Paramorphism on lists (strictly, from the left).\ÀCompares length of two lists without traversing them completely.]Puts text between each item.^Replicates text into a builder._î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.`Ù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.)NThe source table.The 0 to render.+The pointers of each block grouped by line.The mininum line of each block.The maxinum line of each block.OThe source table.The block to render.+The pointers of this block grouped by line.,The mininum and maximum lines of this block.PÊThe source lines, from the minimum line to the maximum line for the block.The block to render.4The length of the actual number of the maximum line.+The pointers of this block grouped by line.Z3Catch up from the previous pointer to this pointer.&catchUp distance isFirst pointers text' should return text of at least length distance.8Add text underneath the pointer before the next pointer.(underlinePointer pointerLen pointer text' should return the text and its length.KLONJPMJNOPKML(c) 2020- compMITonecomputer00@gmail.comstableportable Safe-Inferred5AQÐCreates a simple error that has a single block, with an optional header or body.RàA simple block that points to only one line and optionally has a label, header, or body message.S A variant of R that only points at one column.TÔA block that points to two parts of the source that are visually connected together.U A variant of T- where the pointers point at only one column.VÔ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.W A variant of V- where the pointers point at only one column.X?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, [, {Q The header. The block. The body.RThe style of the block.The style of the pointer. The filepath.The header message.The second line number and column, starting at 1, and a label.The body message.VThe style of the block.The style of the pointer. The filepath.The header message.ÂThe first line number and column span, starting at 1, and a label.ÃThe second line number and column span, starting at 1, and a label.8The label for when the two pointers are merged into one.The body message.WThe style of the block.The style of the pointer. The filepath.The header message.=The first line number and column, starting at 1, and a label.>The second line number and column, starting at 1, and a label.8The label for when the two pointers are merged into one.The body message.6TUVWRSQX)*+-.,/01324!"&'%$(#  601432Q)*/.-,+RSTUVW!"('&%$#  Xá !"#$%&'()*+,---.-/-0-1-2-3444546474849:;<=>?@ABCDEFGH  IJKLMN OPQRSTUVWXYZ[\]^_`abcdefgèerrata-0.4.0.3-inplace Errata.Source Errata.Types Errata.StylesErrata.Internal.RenderErrataerrata Data.TextText highlightData.Text.Lazy basicStyle basicPointerpackSource emptySource sourceToLines sourceToText $fSourceText $fSourceText0 $fSourceList PointerStylestyleEnableHookstyleConnector styleHookstyleUnderlinestyleHighlightStylestyleEnableLinePrefixstyleEnableDecorationsstylePaddingBottomstylePaddingTopstyleExtraLinesBeforestyleExtraLinesAfter styleTabWidthstyleUpDownRight styleUpRightstyleDownRightstyleHorizontal styleVerticalstyleLinePrefix styleEllipsis styleLine styleNumber styleLocationPointer pointerStyle pointerLabelpointerConnect pointerColEndpointerColStart pointerLineBlock blockBody blockPointers blockHeader blockLocation blockStyle errataBody errataBlocks errataHeaderLabelBodyHeaderColumnLinepointerColumns 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