pick method

  1. @useResult
Parser<R> pick(
  1. int index
)

Returns a parser that transforms a successful parse result by returning the element at index of a list. A negative index can be used to access the elements from the back of the list.

For example, the parser letter().star().pick(-1) returns the last letter parsed. For the input 'abc' it returns 'c'.

Implementation

@useResult
Parser<R> pick(int index) => PickParser<R>(this, index);