mirror of
https://github.com/github/semantic.git
synced 2024-12-24 07:25:44 +03:00
Match on syntax
inside annotatedToRows
.
This commit is contained in:
parent
00826a1a82
commit
92d5d9cf4f
@ -146,8 +146,9 @@ termToLines (Info range _ categories :< syntax) source = (rows syntax, range)
|
|||||||
|
|
||||||
-- | 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))
|
||||||
annotatedToRows (Annotated (Info left _ leftCategories, Info right _ rightCategories) (Leaf _)) before after = (zipWithMaybe rowFromMaybeRows leftElements rightElements, (left, right))
|
annotatedToRows (Annotated (Info left _ leftCategories, Info right _ rightCategories) syntax) before after = (rows syntax, (left, right))
|
||||||
where
|
where
|
||||||
|
rows (Leaf _) = zipWithMaybe rowFromMaybeRows leftElements rightElements
|
||||||
leftElements = (elementAndBreak $ Span (classify leftCategories)) =<< actualLines (substring left before)
|
leftElements = (elementAndBreak $ Span (classify leftCategories)) =<< actualLines (substring left before)
|
||||||
rightElements = (elementAndBreak $ Span (classify rightCategories)) =<< actualLines (substring right after)
|
rightElements = (elementAndBreak $ Span (classify rightCategories)) =<< actualLines (substring right after)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user