1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Factor labels in.

This commit is contained in:
Rob Rix 2017-08-31 11:05:11 -04:00
parent 2e671db7e3
commit 1cec072932

View File

@ -186,7 +186,8 @@ choice alternatives = tracing (Choose symbols (IntMap.fromList choices) (asum (f
toChoices rule = case rule of toChoices rule = case rule of
Tracing _ (Choose s c a) `Then` continue -> (s, IntMap.toList (fmap continue c), toList (fmap continue a)) 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 _ (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 _ (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]) _ -> ([], [], [rule])
-- | Match and advance past a node with the given symbol. -- | Match and advance past a node with the given symbol.