1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00

Split the body of spanAndSplitFirstLines onto a newline and dedent.

This commit is contained in:
Rob Rix 2016-04-13 16:05:48 -04:00
parent b8bc77bb7f
commit 0ea6286197

View File

@ -155,8 +155,9 @@ group2 ranges children | Just (headRanges, tailRanges) <- unconsThese ranges
spanAndSplitFirstLines :: (Join These a -> Join These Bool) -> [[Join These a]] -> ([(Join These a, [Join These a])], [[Join These a]]) spanAndSplitFirstLines :: (Join These a -> Join These Bool) -> [[Join These a]] -> ([(Join These a, [Join These a])], [[Join These a]])
spanAndSplitFirstLines pred = foldr go ([], []) spanAndSplitFirstLines pred = foldr go ([], [])
where go (first : rest) (intersecting, nonintersecting) = where go child (intersecting, nonintersecting)
let ~(l, r) = split first in case fromThese False False . runJoin $ pred first of | (first : rest) <- child = let ~(l, r) = split first in
case fromThese False False . runJoin $ pred first of
(True, True) -> ((first, rest) : intersecting, nonintersecting) (True, True) -> ((first, rest) : intersecting, nonintersecting)
(True, False) -> ((head l, r ++ rest) : intersecting, nonintersecting) (True, False) -> ((head l, r ++ rest) : intersecting, nonintersecting)
(False, True) -> ((head r, l ++ rest) : intersecting, nonintersecting) (False, True) -> ((head r, l ++ rest) : intersecting, nonintersecting)