1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00

Fail fast on no children, too.

This commit is contained in:
Rob Rix 2016-05-26 16:05:12 -04:00
parent 4b2a010e3e
commit c0e54c56f4

View File

@ -171,8 +171,8 @@ headRangesOf ranges = sequenceL (listToMaybe <$> Join (runBothWith These ranges)
linesOf :: (Copointed c, Functor c) => (term -> Range) -> [c [Join These term]] -> Both [Range] -> [Join These (Range, [c term])]
linesOf getRange children ranges
| Join ([], []) <- ranges
= []
| Join ([], []) <- ranges = []
| [] <- children = []
| (first:rest) <- children
, null (copoint first) = linesOf getRange rest ranges
| otherwise = let (intersections, remaining) = alignChildren getRange children headRanges