From ec8be238d18061d4ff24744f9e9192fc4cfa3bc7 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 28 Apr 2017 15:19:55 -0400 Subject: [PATCH] Children assignments continue after the last child assignment. --- src/Data/Syntax/Assignment.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Syntax/Assignment.hs b/src/Data/Syntax/Assignment.hs index 66962c89b..c89631990 100644 --- a/src/Data/Syntax/Assignment.hs +++ b/src/Data/Syntax/Assignment.hs @@ -104,7 +104,7 @@ runAssignment = iterFreer run . fmap (\ a state -> Result (state, a)) (Location, []) -> yield (Info.Range stateOffset stateOffset :. Info.SourceSpan statePos statePos :. Nil) state (Source, Rose (_ :. range :. _) _ : _) -> yield (Source.sourceText (Source.slice (offsetRange range (negate stateOffset)) stateSource)) (advanceState state) (Children childAssignment, Rose _ children : _) -> case assignAllFrom childAssignment state { stateNodes = children } of - Result (_, a) -> yield a (advanceState state) + Result (state', a) -> yield a (advanceState state' { stateNodes = stateNodes }) Error e -> Error e (Choose choices, Rose (symbol :. _) _ : _) | Just a <- IntMap.lookup (fromEnum symbol) choices -> yield a state -- Nullability: some rules, e.g. 'pure a' and 'many a', should match at the end of input. Either side of an alternation may be nullable, ergo Alt can match at the end of input.