starSeparated<S> method

  1. @useResult
Parser<SeparatedList<R, S>> starSeparated<S>(
  1. Parser<S> separator
)

Returns a parser that consumes the receiver zero or more times separated by the separator parser. The resulting parser returns a SeparatedList containing collections of both the elements of type R as well as the separators of type S.

For example, the parser digit().starSeparated(anyOf(',;')) returns a parser that consumes input like '1,2;3' and that returns a SeparatedList with elements ['1', '2', '3'] as well as the separators [',', ';'].

Implementation

@useResult
Parser<SeparatedList<R, S>> starSeparated<S>(Parser<S> separator) =>
    repeatSeparated<S>(separator, 0, unbounded);