- choice<TToken, TOptions, TValue>(...ps: [...Parser<TToken, TOptions, TValue>[], Matcher<TToken, TOptions, TValue>]): Matcher<TToken, TOptions, TValue>
-
Parameters
-
Rest
...ps: [...Parser<TToken, TOptions, TValue>[], Matcher<TToken, TOptions, TValue>]
Returns Matcher<TToken, TOptions, TValue>
- choice<TToken, TOptions, TValue>(...ps: Parser<TToken, TOptions, TValue>[]): Parser<TToken, TOptions, TValue>
-
Parameters
-
Rest
...ps: Parser<TToken, TOptions, TValue>[]
Returns Parser<TToken, TOptions, TValue>
This overload makes a Matcher that tries multiple parsers (last entry is a matcher) at the same position and returns the first successful match.