mirror of
https://github.com/github/semantic.git
synced 2024-12-19 12:51:52 +03:00
Committed choices with alternatives attempt the alternative.
This commit is contained in:
parent
51185311af
commit
f79e118d2e
@ -274,7 +274,7 @@ runAssignment toNode source = (\ assignment state -> go assignment state >>= req
|
||||
Children child -> do
|
||||
(a, state') <- go child state { stateNodes = toList node } >>= requireExhaustive
|
||||
yield a (advance state' { stateNodes = stateNodes state })
|
||||
Choose choices _ | Just choice <- IntMap.lookup (fromEnum (nodeSymbol (toNode node))) choices -> yield choice state
|
||||
Choose choices atEnd | Just choice <- IntMap.lookup (fromEnum (nodeSymbol (toNode node))) choices -> maybe id (flip (<>) . flip yield state) atEnd (yield choice state)
|
||||
_ -> anywhere (Just node)
|
||||
|
||||
anywhere node = case assignment of
|
||||
|
Loading…
Reference in New Issue
Block a user