parse method
Implementation
@override
Result<String>? parse(State<StringReader> state) {
if (m > n) {
throw RangeError.range(m, 0, n, 'm');
}
final input = state.input;
final pos = state.pos;
var count = 0;
while (count < n && state.pos < input.length) {
final c = input.readChar(state.pos);
final v = f(c);
if (!v) {
break;
}
state.pos += input.count;
count++;
}
if (count >= m) {
return const Result('');
}
final failPos = state.pos;
state.pos = pos;
return state.failAt(failPos, const ErrorUnexpectedCharacter());
}