mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
fmap takeAndContinue.
This commit is contained in:
parent
d59d0dbe86
commit
2d2fc220fc
@ -18,8 +18,8 @@ offsetRange i (Range start end) = Range (i + start) (i + end)
|
|||||||
rangesAndWordsFrom :: Int -> String -> [(Range, String)]
|
rangesAndWordsFrom :: Int -> String -> [(Range, String)]
|
||||||
rangesAndWordsFrom _ "" = []
|
rangesAndWordsFrom _ "" = []
|
||||||
rangesAndWordsFrom startIndex string =
|
rangesAndWordsFrom startIndex string =
|
||||||
case parse isWord string <|> parse (not . isWordOrSeparator) string of
|
case takeAndContinue <$> (parse isWord string <|> parse (not . isWordOrSeparator) string) of
|
||||||
Just parsed -> takeAndContinue parsed
|
Just a -> a
|
||||||
Nothing ->
|
Nothing ->
|
||||||
case parse Char.isSpace string of
|
case parse Char.isSpace string of
|
||||||
Just parsed -> skipAndContinue parsed
|
Just parsed -> skipAndContinue parsed
|
||||||
|
Loading…
Reference in New Issue
Block a user