parseAsync method
Experimental. Not yet fully implemented
Implementation
@override
AsyncResult<Object?> parseAsync(State<ChunkedData<I>> state) {
final result = AsyncResult<Object?>();
final pos = state.pos;
final r1 = p.parseAsync(state);
void handle() {
result.ok = r1.ok != true;
if (result.ok == false) {
state.pos = pos;
state.fail<Object?>(ErrorUnexpectedInput(pos - state.pos));
} else {
result.value = const Result<Object?>(null);
}
state.input.handler = result.handler;
}
if (r1.ok != null) {
handle();
} else {
r1.handler = handle;
}
return result;
}