mirror of
https://github.com/github/semantic.git
synced 2024-12-27 00:44:57 +03:00
Avoid using wrap.
This commit is contained in:
parent
40c467fc5d
commit
2430e16f79
@ -200,7 +200,7 @@ choice :: (Enum grammar, Eq1 ast, Ix grammar, HasCallStack) => [Assignment ast g
|
||||
choice [] = empty
|
||||
choice alternatives
|
||||
| null choices = asum alternatives
|
||||
| otherwise = tracing (Choose (Table.fromListWith (<|>) choices) (wrap . tracing . Alt . toList <$> nonEmpty atEnd) (mergeHandlers handlers)) `Then` pure
|
||||
| otherwise = tracing (Choose (Table.fromListWith (<|>) choices) ((`Then` id) . tracing . Alt . toList <$> nonEmpty atEnd) (mergeHandlers handlers)) `Then` pure
|
||||
where (choices, atEnd, handlers) = foldMap toChoices alternatives
|
||||
toChoices :: (Enum grammar, Ix grammar) => Assignment ast grammar a -> ([(grammar, Assignment ast grammar a)], [Assignment ast grammar a], [Error (Either String grammar) -> Assignment ast grammar a])
|
||||
toChoices rule = case rule of
|
||||
|
Loading…
Reference in New Issue
Block a user