mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Parse words and punctuation via the atoms.
This commit is contained in:
parent
cf072208fd
commit
36e495f918
@ -18,7 +18,7 @@ offsetRange i (Range start end) = Range (i + start) (i + end)
|
||||
rangesAndWordsFrom :: Int -> String -> [(Range, String)]
|
||||
rangesAndWordsFrom _ "" = []
|
||||
rangesAndWordsFrom startIndex string =
|
||||
case takeAndContinue <$> (parse isWord string <|> parse (not . isWordOrSpace) string) of
|
||||
case takeAndContinue <$> (word <|> punctuation) of
|
||||
Just a -> a
|
||||
Nothing ->
|
||||
case parse Char.isSpace string of
|
||||
|
Loading…
Reference in New Issue
Block a user