simplify
This commit is contained in:
parent
5253379953
commit
b62123c378
1 changed files with 4 additions and 4 deletions
|
@ -50,10 +50,10 @@ token t = error $ "unknown token " ++ t
|
|||
|
||||
{- Converts a list of Tokens into a Matcher. -}
|
||||
generate :: [Token op] -> Matcher op
|
||||
generate ts = generate' MAny ts
|
||||
generate' :: Matcher op -> [Token op] -> Matcher op
|
||||
generate' m [] = m
|
||||
generate' m ts = uncurry generate' $ consume m ts
|
||||
generate = go MAny
|
||||
where
|
||||
go m [] = m
|
||||
go m ts = uncurry go $ consume m ts
|
||||
|
||||
{- Consumes one or more Tokens, constructs a new Matcher,
|
||||
- and returns unconsumed Tokens. -}
|
||||
|
|
Loading…
Reference in a new issue