- peek<TToken, TOptions, TValue>(p: Matcher<TToken, TOptions, TValue>, f: ((r: Match<TValue>, data: Data<TToken, TOptions>, i: number) => void)): Matcher<TToken, TOptions, TValue>
-
Parameters
-
p: Matcher<TToken, TOptions, TValue>
-
f: ((r: Match<TValue>, data: Data<TToken, TOptions>, i: number) => void)
-
- (r: Match<TValue>, data: Data<TToken, TOptions>, i: number): void
-
Parameters
-
r: Match<TValue>
-
data: Data<TToken, TOptions>
-
i: number
Returns void
Returns Matcher<TToken, TOptions, TValue>
- peek<TToken, TOptions, TValue>(p: Parser<TToken, TOptions, TValue>, f: ((r: Result<TValue>, data: Data<TToken, TOptions>, i: number) => void)): Parser<TToken, TOptions, TValue>
-
Parameters
-
p: Parser<TToken, TOptions, TValue>
-
f: ((r: Result<TValue>, data: Data<TToken, TOptions>, i: number) => void)
-
- (r: Result<TValue>, data: Data<TToken, TOptions>, i: number): void
-
Parameters
-
-
data: Data<TToken, TOptions>
-
i: number
Returns void
Returns Parser<TToken, TOptions, TValue>
This overload adds a side effect to a Matcher without changing it's result.
Use action if there is nothing to wrap and you need a non-consuming parser instead.