A parser.
Matched results are accumulated while this type guard test passes.
Make a Matcher that returns all (0 or more)
sequential matches of the same given parser while the test function
equates to true
.
Use many if there is no stop condition.
Use takeWhileP if the stop condition is expressed as a parser.
Use filter to take one match or a non-match based on a test function.
A parser.
Matched results are accumulated while the result of this function is true
.
Current value matched by the parser.
Number of matches so far (including the current value).
Data object (tokens and options).
Parser position in the tokens array (before the current value matched).
Parser position in the tokens array (after the current value matched).
This overload makes a Matcher that returns all (0 or more) sequential matches of the same given parser while the type guard test passes.
Use many if there is no stop condition.
Use takeWhileP if the stop condition is expressed as a parser.
Use filter to take one match or a non-match based on a test function (can also be a type guard).