pick method

Parser<T> 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

Parser<T> pick(int index) => PickParser<T>(this, index);