Safe Haskell | Safe-Inferred |
---|
- splitToks :: IsToken a => (SimpPos, SimpPos) -> [a] -> ([a], [a], [a])
- ghead :: String -> [a] -> a
- glast :: String -> [a] -> a
- gtail :: String -> [a] -> [a]
- gfromJust :: [Char] -> Maybe a -> a
- addEndOffsets :: IsToken a => LayoutTree a -> [a] -> LayoutTree a
- calcLastTokenPos :: IsToken a => [a] -> (Int, Int)
- makeOffset :: RowOffset -> ColOffset -> EndOffset
- makeLeaf :: IsToken a => SimpSpan -> Layout -> [a] -> LayoutTree a
- makeLeafFromToks :: IsToken a => [a] -> [LayoutTree a]
- splitToksIncComments :: IsToken a => (SimpPos, SimpPos) -> [a] -> ([a], [a], [a])
- makeGroup :: IsToken a => [LayoutTree a] -> LayoutTree a
- makeGroupLayout :: IsToken a => Layout -> [LayoutTree a] -> LayoutTree a
- makeSpanFromTrees :: [LayoutTree a] -> ForestSpan
- mkGroup :: IsToken a => SimpSpan -> Layout -> [LayoutTree a] -> LayoutTree a
- subTreeOnly :: IsToken a => [LayoutTree a] -> [LayoutTree a]
- splitToksForList :: (IsToken a, HasLoc b) => [b] -> [a] -> ([a], [a], [a])
- placeAbove :: IsToken a => EndOffset -> (Row, Col) -> (Row, Col) -> [LayoutTree a] -> LayoutTree a
- allocList :: (IsToken a, HasLoc b) => [b] -> [a] -> (b -> [a] -> [LayoutTree a]) -> [LayoutTree a]
- strip :: IsToken a => [LayoutTree a] -> [LayoutTree a]
- startEndLocIncComments' :: IsToken a => [a] -> (SimpPos, SimpPos) -> (SimpPos, SimpPos)
- simpPosToForestSpan :: (SimpPos, SimpPos) -> ForestSpan
- ss2f :: (SimpPos, SimpPos) -> ForestSpan
- forestSpanToSimpPos :: ForestSpan -> (SimpPos, SimpPos)
- f2ss :: ForestSpan -> (SimpPos, SimpPos)
- treeIdFromForestSpan :: ForestSpan -> TreeId
- forestSpanVersions :: ForestSpan -> (Int, Int)
- forestSpanAstVersions :: ForestSpan -> (Int, Int)
- forestSpanLenChangedFlags :: ForestSpan -> (Bool, Bool)
- forestSpanVersionNotSet :: ForestSpan -> Bool
- forestPosVersionSet :: ForestPos -> Bool
- forestPosAstVersionSet :: ForestPos -> Bool
- forestPosVersionNotSet :: ForestPos -> Bool
- forestSpanLenChanged :: ForestSpan -> Bool
- forestPosLenChanged :: ForestPos -> Bool
- treeIdIntoForestSpan :: TreeId -> ForestSpan -> ForestSpan
- spanContains :: ForestSpan -> ForestSpan -> Bool
- insertVersionsInForestSpan :: Int -> Int -> ForestSpan -> ForestSpan
- insertLenChangedInForestSpan :: Bool -> ForestSpan -> ForestSpan
- forestSpanFromEntry :: Entry a -> ForestSpan
- putForestSpanInEntry :: Entry a -> ForestSpan -> Entry a
- forestSpanVersionSet :: ForestSpan -> Bool
- treeStartEnd :: Tree (Entry a) -> ForestSpan
- groupTokensByLine :: IsToken a => [a] -> [[a]]
- tokenRow :: IsToken a => a -> Int
- tokenCol :: IsToken a => a -> Int
- tokenColEnd :: IsToken a => a -> Int
- tokenPos :: IsToken a => a -> SimpPos
- tokenPosEnd :: IsToken a => a -> SimpPos
- increaseSrcSpan :: IsToken a => SimpPos -> a -> a
- srcPosToSimpPos :: (Int, Int) -> (Int, Int)
- addOffsetToToks :: IsToken a => SimpPos -> [a] -> [a]
- decorate :: IsToken a => LayoutTree a -> [a] -> LayoutTree a
- combineSpans :: ForestSpan -> ForestSpan -> ForestSpan
- nonCommentSpan :: IsToken a => [a] -> (SimpPos, SimpPos)
- getStartLoc :: SimpSpan -> SimpPos
- getEndLoc :: SimpSpan -> SimpPos
- drawTreeEntry :: Tree (Entry a) -> String
- drawForestEntry :: Forest (Entry a) -> String
- showLayout :: Layout -> String
- drawTreeCompact :: Tree (Entry a) -> String
- drawTreeWithToks :: IsToken a => Tree (Entry a) -> String
- showForestSpan :: ForestSpan -> String
- drawTokenCache :: IsToken a => TokenCache a -> String
- drawTokenCacheDetailed :: IsToken a => TokenCache a -> String
- divideComments :: IsToken a => Int -> Int -> [a] -> ([a], [a])
Documentation
splitToks :: IsToken a => (SimpPos, SimpPos) -> [a] -> ([a], [a], [a])Source
Split the token stream into three parts: the tokens before the startPos, the tokens between startPos and endPos, and the tokens after endPos. Note: The startPos and endPos refer to the startPos of a token only. So a single token will have the same startPos and endPos NO^^^^
addEndOffsets :: IsToken a => LayoutTree a -> [a] -> LayoutTree aSource
calcLastTokenPos :: IsToken a => [a] -> (Int, Int)Source
makeOffset :: RowOffset -> ColOffset -> EndOffsetSource
makeLeafFromToks :: IsToken a => [a] -> [LayoutTree a]Source
splitToksIncComments :: IsToken a => (SimpPos, SimpPos) -> [a] -> ([a], [a], [a])Source
Split the given tokens to include the comments belonging to the span.
makeGroup :: IsToken a => [LayoutTree a] -> LayoutTree aSource
makeGroupLayout :: IsToken a => Layout -> [LayoutTree a] -> LayoutTree aSource
makeSpanFromTrees :: [LayoutTree a] -> ForestSpanSource
mkGroup :: IsToken a => SimpSpan -> Layout -> [LayoutTree a] -> LayoutTree aSource
subTreeOnly :: IsToken a => [LayoutTree a] -> [LayoutTree a]Source
splitToksForList :: (IsToken a, HasLoc b) => [b] -> [a] -> ([a], [a], [a])Source
Split the given tokens into the ones that occur prior to the start of the list and ones that occur after
placeAbove :: IsToken a => EndOffset -> (Row, Col) -> (Row, Col) -> [LayoutTree a] -> LayoutTree aSource
allocList :: (IsToken a, HasLoc b) => [b] -> [a] -> (b -> [a] -> [LayoutTree a]) -> [LayoutTree a]Source
strip :: IsToken a => [LayoutTree a] -> [LayoutTree a]Source
startEndLocIncComments' :: IsToken a => [a] -> (SimpPos, SimpPos) -> (SimpPos, SimpPos)Source
Get the start&end location of t in the token stream, then extend the start and end location to cover the preceding and following comments.
ForestSpan conversions
ss2f :: (SimpPos, SimpPos) -> ForestSpanSource
forestSpanToSimpPos :: ForestSpan -> (SimpPos, SimpPos)Source
Strip out the version markers
f2ss :: ForestSpan -> (SimpPos, SimpPos)Source
ForestSpans
forestSpanVersions :: ForestSpan -> (Int, Int)Source
Gets the version numbers
forestSpanAstVersions :: ForestSpan -> (Int, Int)Source
Gets the AST tree numbers
forestSpanLenChangedFlags :: ForestSpan -> (Bool, Bool)Source
Gets the SpanLengthChanged flags
forestSpanVersionNotSet :: ForestSpan -> BoolSource
Checks if the version is zero in both positions
forestPosVersionSet :: ForestPos -> BoolSource
Checks if the version is non-zero
forestPosAstVersionSet :: ForestPos -> BoolSource
Checks if the AST version is non-zero
forestPosVersionNotSet :: ForestPos -> BoolSource
Checks if the version is zero
forestSpanLenChanged :: ForestSpan -> BoolSource
forestPosLenChanged :: ForestPos -> BoolSource
treeIdIntoForestSpan :: TreeId -> ForestSpan -> ForestSpanSource
Puts a TreeId into a forestSpan
spanContains :: ForestSpan -> ForestSpan -> BoolSource
Does the first span contain the second? Takes cognisance of the various flags a ForestSpan can have. NOTE: This function relies on the Eq instance for ForestLine
insertVersionsInForestSpan :: Int -> Int -> ForestSpan -> ForestSpanSource
insertLenChangedInForestSpan :: Bool -> ForestSpan -> ForestSpanSource
forestSpanFromEntry :: Entry a -> ForestSpanSource
putForestSpanInEntry :: Entry a -> ForestSpan -> Entry aSource
forestSpanVersionSet :: ForestSpan -> BoolSource
Checks if the version is non-zero in either position
treeStartEnd :: Tree (Entry a) -> ForestSpanSource
Get the start and end position of a Tree treeStartEnd :: Tree Entry -> (SimpPos,SimpPos) treeStartEnd (Node (Entry sspan _) _) = (getGhcLoc sspan,getGhcLocEnd sspan)
groupTokensByLine :: IsToken a => [a] -> [[a]]Source
tokenColEnd :: IsToken a => a -> IntSource
tokenPosEnd :: IsToken a => a -> SimpPosSource
increaseSrcSpan :: IsToken a => SimpPos -> a -> aSource
Shift the whole token by the given offset
srcPosToSimpPos :: (Int, Int) -> (Int, Int)Source
addOffsetToToks :: IsToken a => SimpPos -> [a] -> [a]Source
Add a constant line and column offset to a span of tokens
decorate :: IsToken a => LayoutTree a -> [a] -> LayoutTree aSource
Spans
combineSpans :: ForestSpan -> ForestSpan -> ForestSpanSource
ForestSpan version of GHC combineSrcSpans
nonCommentSpan :: IsToken a => [a] -> (SimpPos, SimpPos)Source
Extract the start and end position of a span, without any leading or trailing comments
getStartLoc :: SimpSpan -> SimpPosSource
drawing the various trees
drawTreeEntry :: Tree (Entry a) -> StringSource
Neat 2-dimensional drawing of a tree.
drawForestEntry :: Forest (Entry a) -> StringSource
Neat 2-dimensional drawing of a forest.
showLayout :: Layout -> StringSource
drawTreeCompact :: Tree (Entry a) -> StringSource
drawTreeWithToks :: IsToken a => Tree (Entry a) -> StringSource
showForestSpan :: ForestSpan -> StringSource
drawTokenCache :: IsToken a => TokenCache a -> StringSource
Call drawTreeEntry on the entire token cache
drawTokenCacheDetailed :: IsToken a => TokenCache a -> StringSource
Call drawTreeEntry on the entire token cache
divideComments :: IsToken a => Int -> Int -> [a] -> ([a], [a])Source
Split a set of comment tokens into the ones that belong with the startLine and those that belong with the endLine