1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00

Rename rightElements → elements.

This commit is contained in:
Rob Rix 2015-12-07 16:05:23 -05:00
parent 1ff87605e8
commit c88d81a021

View File

@ -93,7 +93,7 @@ instance Monoid Line where
termToLines :: Term a Info -> String -> ([Line], Range) termToLines :: Term a Info -> String -> ([Line], Range)
termToLines (Info range _ categories :< syntax) source = (rows syntax, range) termToLines (Info range _ categories :< syntax) source = (rows syntax, range)
where where
rows (Leaf _) = Line . (:[]) <$> rightElements rows (Leaf _) = Line . (:[]) <$> elements
rows (Indexed i) = rewrapLineContentsInUl <$> childLines i rows (Indexed i) = rewrapLineContentsInUl <$> childLines i
rewrapLineContentsInUl (Line elements) = Line [ Ul (classify categories) elements ] rewrapLineContentsInUl (Line elements) = Line [ Ul (classify categories) elements ]
@ -105,7 +105,7 @@ termToLines (Info range _ categories :< syntax) source = (rows syntax, range)
separatorLines = lineElements (Range previous $ start childRange) source separatorLines = lineElements (Range previous $ start childRange) source
allLines = lines `adjoinLines` separatorLines `adjoinLines` childLines allLines = lines `adjoinLines` separatorLines `adjoinLines` childLines
(childLines, childRange) = termToLines child source (childLines, childRange) = termToLines child source
rightElements = Span (classify categories) <$> actualLines (substring range source) elements = Span (classify categories) <$> actualLines (substring range source)
-- | Given an Annotated and before/after strings, returns a list of `Row`s representing the newline-separated diff. -- | Given an Annotated and before/after strings, returns a list of `Row`s representing the newline-separated diff.
annotatedToRows :: Annotated a (Info, Info) (Diff a Info) -> String -> String -> ([Row], (Range, Range)) annotatedToRows :: Annotated a (Info, Info) (Diff a Info) -> String -> String -> ([Row], (Range, Range))