parseAsync method

  1. @override
AsyncResult<O2> parseAsync(
  1. State<ChunkedData<I>> state
)
override

Experimental. Not yet fully implemented

Implementation

@override
AsyncResult<O2> parseAsync(State<ChunkedData<I>> state) {
  final result = AsyncResult<O2>();
  final r1 = p.parseAsync(state);
  void handle() {
    if ((result.ok = r1.ok) == true) {
      result.value = Result(value);
    }

    state.input.handler = result.handler;
  }

  if (r1.ok != null) {
    handle();
  } else {
    r1.handler = handle;
  }

  return result;
}