1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Extract a skipAndContinue function.

This commit is contained in:
Rob Rix 2015-12-14 16:27:36 -05:00
parent c1c50915d3
commit 025565ac68

View File

@ -26,6 +26,7 @@ rangesAndWordsFrom startIndex string =
Nothing -> []
where
takeAndContinue (parsed, rest) = (Range startIndex $ startIndex + length parsed, parsed) : rangesAndWordsFrom (startIndex + length parsed) rest
skipAndContinue (parsed, rest) = rangesAndWordsFrom (startIndex + length parsed) rest
parse predicate string = case span predicate string of
([], _) -> Nothing
(parsed, rest) -> Just (parsed, rest)