skip method

  1. @useResult
Parser<R> skip({
  1. Parser<void>? before,
  2. Parser<void>? after,
})

Returns a parser that consumes input before and after the receiver, but discards the parse results of before and after and only returns the result of the receiver.

For example, the parser digit().skip(char('['), char(']')) returns '3' for the input '[3]'.

Implementation

@useResult
Parser<R> skip({Parser<void>? before, Parser<void>? after}) =>
    SkipParser<R>(this,
        before: before ?? epsilon(), after: after ?? epsilon());