1
1
mirror of https://github.com/github/semantic.git synced 2025-01-02 12:23:08 +03:00

Inline run.

This commit is contained in:
Rob Rix 2017-06-26 12:12:46 -04:00
parent af3038fc1f
commit 006dac8f68

View File

@ -266,6 +266,7 @@ runAssignment toRecord = iterFreer run . fmap ((pure .) . (,))
runMany rule state = case runAssignment toRecord rule state of
Result _ (Just (a, state')) -> let (as, state'') = runMany rule state' in as `seq` (a : as, state'')
_ -> ([], state)
{-# INLINE run #-}
dropAnonymous :: (Symbol grammar, Recursive ast) => (forall x. Base ast x -> Maybe grammar) -> AssignmentState ast -> AssignmentState ast
dropAnonymous toSymbol state = state { stateNodes = dropWhile ((`notElem` [Just Regular, Nothing]) . fmap symbolType . toSymbol . F.project) (stateNodes state) }