mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
Always return at least one zero-width match.
This commit is contained in:
parent
519c43d39d
commit
0678c2aeee
@ -271,7 +271,7 @@ runAssignment toNode source = (requireExhaustive <=<) . go
|
||||
where loop state = case go rule state of
|
||||
Left err -> ([], state { stateError = Just err })
|
||||
Right (a, state') | ((/=) `on` stateCounter) state state', (as, state'') <- loop state' -> as `seq` (a : as, state'')
|
||||
| otherwise -> ([], state')
|
||||
| otherwise -> ([a], state')
|
||||
{-# INLINE runMany #-}
|
||||
|
||||
requireExhaustive :: (result, State ast grammar) -> Either (Error grammar) (result, State ast grammar)
|
||||
|
Loading…
Reference in New Issue
Block a user