Copyright | (c) 2020- comp |
---|---|
License | MIT |
Maintainer | onecomputer00@gmail.com |
Stability | stable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Type definitions. Most of these are re-exported in Errata, so you should not need to import this module, unless you need some of the helper functions for making new functionality on top of Errata.
Synopsis
- type Line = Int
- type Column = Int
- type Header = Text
- type Body = Text
- type Label = Text
- data Errata = Errata {
- errataHeader :: Maybe Header
- errataBlocks :: [Block]
- errataBody :: Maybe Body
- data Block = Block {
- blockStyle :: Style
- blockLocation :: (FilePath, Line, Column)
- blockHeader :: Maybe Header
- blockPointers :: [Pointer]
- blockBody :: Maybe Body
- data Pointer = Pointer {}
- pointerColumns :: Pointer -> (Column, Column)
- pointerData :: Pointer -> (Line, Column, Column, Bool, Maybe Label)
- data Style = Style {
- styleLocation :: (FilePath, Line, Column) -> Text
- styleNumber :: Line -> Text
- styleLine :: [(PointerStyle, (Column, Column))] -> Text -> Text
- styleEllipsis :: Text
- styleLinePrefix :: Text
- styleVertical :: Text
- styleHorizontal :: Text
- styleDownRight :: Text
- styleUpRight :: Text
- styleUpDownRight :: Text
- styleTabWidth :: Int
- styleExtraLinesAfter :: Int
- styleExtraLinesBefore :: Int
- stylePaddingTop :: Bool
- stylePaddingBottom :: Bool
- styleEnableDecorations :: Bool
- styleEnableLinePrefix :: Bool
- data PointerStyle = PointerStyle {
- styleHighlight :: Text -> Text
- styleUnderline :: Text
- styleHook :: Text
- styleConnector :: Text
- styleEnableHook :: Bool
Type synonyms
Error format data
A collection of information for pretty printing an error.
Errata | |
|
Blocks and pointers
Information about a block in the source code, such as pointers and messages.
Each block has a style associated with it.
Block | |
|
A pointer is the span of the source code at a line, from one column to another. Each of the positions start at 1.
A 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.
Pointer | |
|
pointerData :: Pointer -> (Line, Column, Column, Bool, Maybe Label) Source #
Gets physical information about a pointer.
Styling options
Stylization options for a block, e.g. characters to use.
Style | |
|
data PointerStyle Source #
Stylization options for an individual pointer, e.g. characters to use.
PointerStyle | |
|
Instances
Show PointerStyle Source # | |
Defined in Errata.Types showsPrec :: Int -> PointerStyle -> ShowS # show :: PointerStyle -> String # showList :: [PointerStyle] -> ShowS # |