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 => Span -> 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 => Span -> 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)
- sf :: Span -> ForestSpan
- srcSpanToForestSpan :: Span -> ForestSpan
- fs :: ForestSpan -> Span
- forestSpanToSrcSpan :: ForestSpan -> Span
- 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
- spanStartEnd :: Span -> (SimpPos, SimpPos)
- combineSpans :: ForestSpan -> ForestSpan -> ForestSpan
- nonCommentSpan :: IsToken a => [a] -> (SimpPos, 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 => Span -> 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.
SrcSpan to ForestSpan conversions
sf :: Span -> ForestSpanSource
fs :: ForestSpan -> SpanSource
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
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
Spans
spanStartEnd :: Span -> (SimpPos, SimpPos)Source
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
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
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