times method

ListParser<T> times(
  1. int count,
  2. {bool exact = true,
  3. String tooFew,
  4. String tooMany,
  5. bool backtrack = true,
  6. SyntaxErrorSeverity severity}

Expect this pattern a certain number of times.

If exact is false (default: true), then the generated parser will accept an infinite amount of occurrences after the specified count.

You can provide custom error messages for when there are tooFew or tooMany occurrences.


ListParser<T> times(int count,
    {bool exact: true,
    String tooFew,
    String tooMany,
    bool backtrack: true,
    SyntaxErrorSeverity severity}) {
  return new _Repeat<T>(this, count, exact, tooFew, tooMany, backtrack,
      severity ?? SyntaxErrorSeverity.error);