From 04a9b2dc259a3387cceace67e8dbd39810fee224 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Sun, 6 Aug 2017 08:12:53 -0400 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20call=20error=20handlers=20for?= =?UTF-8?q?=20partial=20matches.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Data/Syntax/Assignment.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Data/Syntax/Assignment.hs b/src/Data/Syntax/Assignment.hs index 86f9676b7..db85fe797 100644 --- a/src/Data/Syntax/Assignment.hs +++ b/src/Data/Syntax/Assignment.hs @@ -297,7 +297,10 @@ runAssignment toNode source = (\ assignment state -> disamb Left (Right . minimu None (err, state') -> if state == state' then next else None (err, state') Some as -> Some as) (None (makeError node, state)) as Throw e -> None (e, state) - Catch during handler -> go during state `catchError` (flip go state { stateErrorCounter = succ stateErrorCounter } . handler . fst) >>= uncurry yield + Catch during handler -> go during state `catchError` (\ (err, state') -> if state == state' then + go (handler err) state { stateErrorCounter = succ stateErrorCounter } + else + None (err, state')) >>= uncurry yield Choose{} -> None (makeError node, state) Project{} -> None (makeError node, state) Children{} -> None (makeError node, state)