Safe Haskell | None |
---|
- data TTreeNode a b
- data TTree a b c = TTree (TTreeNode a b) [(c, TTree a b c)]
- type ClientTTree = TTree LineBuf (RealSrcSpan, Int) BufSpan
- applyTTree :: [(FilePath, LineBuf)] -> (BufSpan, TTree LineBuf (RealSrcSpan, Int) BufSpan) -> LineBuf -> LineBuf
- applyTTreeGeneric :: Maybe (a, attr -> a, (a, attr) -> (LineBuf, LineBuf, LineBuf) -> (LineBuf, LineBuf, LineBuf)) -> [(FilePath, LineBuf)] -> (attr -> BufSpan) -> (attr, TTree LineBuf (RealSrcSpan, Int) attr) -> LineBuf -> LineBuf
- getCacheElement :: FilePath -> [(FilePath, LineBuf)] -> LineBuf
- collectFilenames :: (a, TTree b (RealSrcSpan, Int) a) -> [FilePath]
- cacheFiles :: [FilePath] -> IO [(FilePath, LineBuf)]
Documentation
This is the generic data structure representing a transformation tree.
TransformationTree
The transformation tree is a recursive data structure to represent modifications to text (files). It is used to represent the changes to source code made by the inlining function feature.
Cover-Range
The cover-range is the snippet of code that should be hidden by the new text. For the root of the tree this is a RealSrcSpan (which has a filename attached). For other location the cover-range refers to the text inserted by the parent element.
Children
The text that has been added by for example an addition may be altered again by the usage of nested transformations. These transformations always refer to their parent transformation whichs means that the Cover-Range for example contains lines- and column-indices which refer only to the snipped added by their parent transformation (and not the whole text which is referred to by the top-most addition or display). INVARIANT: Moreover the source-spans elements of child-transformations must be disjoint. Reassembling the transformation-tree can so be done by sorting the child-tranformations by their cover-range in reverse order (so that the last position is taken first) and applying them.
Instance of TTree produced by ConvertibleToTTree:
TTree LineBuf RealSrcSpan InsertionInfo
Instance of TTree that is searialized to JSON:
TTree LineBuf (RealSrcSpan,Int) BufSpan
type ClientTTree = TTree LineBuf (RealSrcSpan, Int) BufSpanSource
applyTTree :: [(FilePath, LineBuf)] -> (BufSpan, TTree LineBuf (RealSrcSpan, Int) BufSpan) -> LineBuf -> LineBufSource
applyTTreeGeneric :: Maybe (a, attr -> a, (a, attr) -> (LineBuf, LineBuf, LineBuf) -> (LineBuf, LineBuf, LineBuf)) -> [(FilePath, LineBuf)] -> (attr -> BufSpan) -> (attr, TTree LineBuf (RealSrcSpan, Int) attr) -> LineBuf -> LineBufSource
getCacheElement :: FilePath -> [(FilePath, LineBuf)] -> LineBufSource
collectFilenames :: (a, TTree b (RealSrcSpan, Int) a) -> [FilePath]Source
cacheFiles :: [FilePath] -> IO [(FilePath, LineBuf)]Source