1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Skip past nonintersecting children.

This resolves failures in two distinct cases where changing the default
for handling asymmetrical ranges had opposite outcomes.
This commit is contained in:
Rob Rix 2016-05-19 16:16:15 -04:00
parent 2fa8060a1c
commit f1d9cc3f2f

View File

@ -176,8 +176,8 @@ alignChildren getRange (first:rest) headRanges
(True, False) -> ((++) <$> toTerms (fromJust l) <*> firstRemaining, (maybeToList r <$ first) : (restOfLines <$ first) : restRemaining)
-- It only intersects on the right, so split it up.
(False, True) -> ((++) <$> toTerms (fromJust r) <*> firstRemaining, (maybeToList l <$ first) : (restOfLines <$ first) : restRemaining)
-- It doesnt intersect at all, so weve exhausted the children for this line.
(False, False) -> (both [] [], first:rest)
-- It doesnt intersect at all, so skip it and move along.
(False, False) -> (firstRemaining, first:restRemaining)
| otherwise = alignChildren getRange rest headRanges
where (firstRemaining, restRemaining) = alignChildren getRange rest headRanges
toTerms line = modifyJoin (fromThese [] []) (pure . (<$ first) <$> line)