mirror of
https://github.com/github/semantic.git
synced 2024-12-20 13:21:59 +03:00
Avoid recomputating the bodies of catch rules.
This commit is contained in:
parent
92f2745bc3
commit
d1e3518732
@ -283,7 +283,7 @@ runAssignment toNode source = (\ assignment state -> go assignment state >>= req
|
|||||||
Many rule -> fix (\ recur list state -> yield list state <> (go rule state >>= \ (a, state') -> if stateCounter state == stateCounter state' then yield (list <> [a]) state' else recur (list <> [a]) state')) [] state
|
Many rule -> fix (\ recur list state -> yield list state <> (go rule state >>= \ (a, state') -> if stateCounter state == stateCounter state' then yield (list <> [a]) state' else recur (list <> [a]) state')) [] state
|
||||||
Alt as -> Some as >>= flip yield state
|
Alt as -> Some as >>= flip yield state
|
||||||
Throw e -> None e
|
Throw e -> None e
|
||||||
Catch during handler -> (go during state >>= uncurry yield) <> (go during state `catchError` (flip go state . handler) >>= uncurry yield)
|
Catch during handler -> let partial = go during state in (partial >>= uncurry yield) <> (partial `catchError` (flip go state . handler) >>= uncurry yield)
|
||||||
Choose{} -> None (makeError node)
|
Choose{} -> None (makeError node)
|
||||||
Project{} -> None (makeError node)
|
Project{} -> None (makeError node)
|
||||||
Children{} -> None (makeError node)
|
Children{} -> None (makeError node)
|
||||||
|
Loading…
Reference in New Issue
Block a user