HaRe-0.7.1.6: the Haskell Refactorer.

Safe HaskellNone

Language.Haskell.Refact.Utils.TokenUtilsTypes

Contents

Description

This module contains types shared between TokenUtils and Monad, and exists to break import cycles

Synopsis

The cache of trees comprising the manipulated tokens

data TokenCache Source

Constructors

TK 

data TreeId Source

Constructors

TId !Int 

Instances

mainTid :: TreeIdSource

Identifies the tree carrying the main tokens, not any work in progress or deleted ones

Structure of each tree

data Entry Source

An entry in the data structure for a particular srcspan.

Constructors

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)

data Layout Source

Constructors

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 

type Row = IntSource

type Col = IntSource

data ForestLine Source

Constructors

ForestLine 

Fields

flSpanLengthChanged :: !Bool

The length of the span may have changed due to updated tokens.

flTreeSelector :: !Int
 
flInsertVersion :: !Int
 
flLine :: !Int
 

type ForestSpan = (ForestPos, ForestPos)Source

Match a SrcSpan, using a ForestLine as the marker

data PprOrigin Source

Constructors

Original

Original tokens

Added

Added tokens

data Ppr Source

A data structure to make the ppr process visible

Constructors

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

Instances