times method
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.
Implementation
ListParser<T> times(int count,
{bool exact = true,
String tooFew = 'Too few',
String tooMany = 'Too many',
bool backtrack = true,
SyntaxErrorSeverity? severity}) {
return _Repeat<T>(this, count, exact, tooFew, tooMany, backtrack,
severity ?? SyntaxErrorSeverity.error);
}