Make a new parser that transforms the match from a given parser to any Result.
This version can discard a Match - return a NonMatch instead.
Note: pay attention to the return type and indices.
Use map if mapping exists for all matched values.
Use filter for discarding some matches based on a condition, without modifying.
A base parser.
A function that modifies the match.
A Match object from the base parser (contains the value and the position after the match).
Data object (tokens and options).
Parser position in the tokens array (before the first parser matched).
A transformed Result object - either Match or NonMatch.
Make a new parser that transforms the match from a given parser to any Result.
This version can discard a Match - return a NonMatch instead.
Note: pay attention to the return type and indices.
Use map if mapping exists for all matched values.
Use filter for discarding some matches based on a condition, without modifying.