Safe Haskell | None |
---|
This module contains types shared between TokenUtils and Monad, and exists to break import cycles
- data TokenCache = TK {}
- data TreeId = TId !Int
- mainTid :: TreeId
- data Entry
- = Entry !ForestSpan !Layout ![PosToken]
- | Deleted !ForestSpan RowOffset SimpPos
- data Layout
- data EndOffset
- type RowOffset = Int
- type ColOffset = Int
- type Row = Int
- type Col = Int
- data ForestLine = ForestLine {
- flSpanLengthChanged :: !Bool
- flTreeSelector :: !Int
- flInsertVersion :: !Int
- flLine :: !Int
- type ForestPos = (ForestLine, Int)
- type ForestSpan = (ForestPos, ForestPos)
- data PprOrigin
- data Ppr
The cache of trees comprising the manipulated tokens
data TokenCache Source
Identifies the tree carrying the main tokens, not any work in progress or deleted ones
Structure of each tree
An entry in the data structure for a particular srcspan.
Entry !ForestSpan !Layout ![PosToken] | The tokens for the SrcSpan if subtree is empty |
Deleted !ForestSpan RowOffset SimpPos | The gap between this span end and the start of the next in the fringe of the tree. deriving (Show) |
Above EndOffset (Row, Col) (Row, Col) EndOffset | Initial offset from token before the stacked list of items, the (r,c) of the first non-comment token, the (r,c) of the end of the last non-comment token in the stacked list to be able to calculate the (RowOffset,ColOffset) between the last token and the start of the next item. |
NoChange |
data ForestLine Source
ForestLine | |
|
type ForestPos = (ForestLine, Int)Source
type ForestSpan = (ForestPos, ForestPos)Source
Match a SrcSpan, using a ForestLine as the marker
A data structure to make the ppr process visible
PprText Row Col PprOrigin String | Original row and col of the tokens making up the string |
PprAbove EndOffset (Row, Col) EndOffset [Ppr] | Offset of start of embedded parts, coords of last token, offset to start of next part, relative to the column of the start |
PprDeleted Row Col RowOffset RowOffset RowOffset | Marks lines that have been deleted together with the original gap before, how many lines were originally included, and gap after. And a note field for debugging |