1
1
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:
Rob Rix 2017-07-22 18:06:32 -04:00
parent 519c43d39d
commit 0678c2aeee

View File

@ -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)