1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 14:54:16 +03:00
This commit is contained in:
Rob Rix 2016-03-04 21:09:00 -05:00
parent 5c06ecc6d0
commit 6610745868

View File

@ -66,7 +66,7 @@ splitAbstractedTerm getInfo getSyntax makeTerm source term = case getSyntax term
childLines (lines, previous) child = let childLines = copoint child in
(adjoin $ lines ++ (pure . (,) Nothing <$> actualLineRanges (Range previous $ start (unionLineRangesFrom (rangeAt previous) childLines)) source) ++ (fmap (flip (,) (unionLineRangesFrom (rangeAt previous) childLines) . Just . (<$ child)) <$> childLines), end (unionLineRangesFrom (rangeAt previous) childLines))
-- | Split a annotated diff into rows of split diffs.
-- | Split an annotated diff into rows of split diffs.
splitAnnotatedByLines :: Both (Source Char) -> Both Info -> Syntax leaf [Row (SplitDiff leaf Info, Range)] -> [Row (SplitDiff leaf Info, Range)]
splitAnnotatedByLines sources infos syntax = case syntax of
Leaf a -> zipWithDefaults makeRow (pure mempty) $ fmap <$> ((\ categories range -> pure (Free (Annotated (Info range categories) (Leaf a)), range)) <$> categories) <*> (actualLineRanges <$> ranges <*> sources)