1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

📝 choice.

This commit is contained in:
Rob Rix 2017-09-01 12:41:05 -04:00
parent 826adc829f
commit 2317d56355

View File

@ -179,6 +179,7 @@ children child = tracing (Children child) `Then` return
advance :: HasCallStack => Assignment ast grammar ()
advance = tracing Advance `Then` return
-- | Construct a committed choice table from a list of alternatives. Use this to efficiently select between long lists of rules.
choice :: (Enum grammar, Eq (ast (AST ast grammar)), Ix grammar, HasCallStack) => [Assignment ast grammar a] -> Assignment ast grammar a
choice [] = empty
choice alternatives