starLazy method

  1. @useResult
Parser<List<R>> starLazy(
  1. Parser<void> limit
)

Returns a parser that parses the receiver zero or more times until it reaches a limit. This is a lazy non-blind implementation of the PossessiveRepeatingParserExtension.star operator. The limit is not consumed.

For example, the parser char('{') & any().starLazy(char('}')) & char('}') only consumes the part '{abc}' of '{abc}def}'.

See GreedyRepeatingParserExtension.starGreedy for the greedy and less efficient variation of this combinator.

Implementation

@useResult
Parser<List<R>> starLazy(Parser<void> limit) =>
    repeatLazy(limit, 0, unbounded);