mirror of
https://github.com/github/semantic.git
synced 2024-12-24 07:25:44 +03:00
Tokenize strings.
This commit is contained in:
parent
40e9068ed8
commit
da793e21d5
@ -10,6 +10,10 @@ import Text.Parsec.String
|
||||
|
||||
data Token = Token { getRange :: Range, getString :: String }
|
||||
|
||||
tokenize :: String -> [Token]
|
||||
tokenize "" = []
|
||||
tokenize string = uncurry Token <$> rangesAndWordsFrom 0 string
|
||||
|
||||
haskellParser :: Parser (Term String Info)
|
||||
haskellParser = toTerm <$> many anyChar
|
||||
where toTerm a = Info (Range 0 0) mempty :< Leaf a
|
||||
|
Loading…
Reference in New Issue
Block a user