From 1cec07293215214b509312a0bf46e73d72996ab7 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 31 Aug 2017 11:05:11 -0400 Subject: [PATCH] Factor labels in. --- src/Data/Syntax/Assignment.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Data/Syntax/Assignment.hs b/src/Data/Syntax/Assignment.hs index 34ac8c2f6..dbc5c1eaf 100644 --- a/src/Data/Syntax/Assignment.hs +++ b/src/Data/Syntax/Assignment.hs @@ -185,8 +185,9 @@ choice alternatives = tracing (Choose symbols (IntMap.fromList choices) (asum (f toChoices :: Assignment ast grammar a -> ([grammar], [(Int, Assignment ast grammar a)], [Assignment ast grammar a]) toChoices rule = case rule of Tracing _ (Choose s c a) `Then` continue -> (s, IntMap.toList (fmap continue c), toList (fmap continue a)) - Tracing _ (Many child) `Then` _ -> let (s, c, _) = toChoices child in (s, fmap (rule <$) c, [rule]) - Tracing _ (Catch during _) `Then` _ -> let (s, c, _) = toChoices during in (s, fmap (rule <$) c, [rule]) + Tracing _ (Many child) `Then` _ -> let (s, c, _) = toChoices child in (s, fmap (rule <$) c, [rule]) + Tracing _ (Catch child _) `Then` _ -> let (s, c, _) = toChoices child in (s, fmap (rule <$) c, [rule]) + Tracing _ (Label child _) `Then` _ -> let (s, c, _) = toChoices child in (s, fmap (rule <$) c, [rule]) _ -> ([], [], [rule]) -- | Match and advance past a node with the given symbol.