parse method
Parses the input and returns a result wrapped in Result if successful,
null
otherwise.
Implementation
@override
Result<String>? parse(State<StringReader> state) {
final input = state.input;
final pos = state.pos;
while (state.pos < input.length) {
final c = input.readChar(state.pos);
if (!f(c)) {
break;
}
state.pos += input.count;
}
return state.pos != pos
? const Result('')
: state.fail(const ErrorUnexpectedCharacter());
}