diff --git a/src/Range.hs b/src/Range.hs index e5661e6b0..3e87d90d2 100644 --- a/src/Range.hs +++ b/src/Range.hs @@ -25,6 +25,9 @@ rangesAndWordsFrom startIndex string = Just parsed -> skipAndContinue parsed Nothing -> [] where + word = parse isWord string + punctuation = parse (not . isWordOrSpace) string + space = parse Char.isSpace string 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