parse method
Parses the input and returns a result wrapped in Result if successful,
null
otherwise.
Implementation
@override
Result<O>? parse(State<I> state) {
final failPos = state.failPos;
final errorCount = state.errorCount;
final r = p.parse(state);
if (r != null) {
return r;
}
if (state.canHandleError(failPos, errorCount)) {
if (state.pos != state.failPos) {
state.clearErrors(failPos, errorCount);
state.failAt<Object?>(
state.failPos, ErrorMessage(state.pos - state.failPos, message));
}
}
return null;
}