permute method

  1. @useResult
Parser<List<R>> permute(
  1. List<int> indexes
)

Returns a parser that transforms a successful parse result by returning the permuted elements at indexes of a list. Negative indexes can be used to access the elements from the back of the list.

For example, the parser letter().star().permute([0, -1]) returns the first and last letter parsed. For the input 'abc' it returns ['a', 'c'].

Implementation

@useResult
Parser<List<R>> permute(List<int> indexes) => PermuteParser<R>(this, indexes);