fastParseSpaces$Async method

AsyncResult<Object?> fastParseSpaces$Async(
  1. State<ChunkedParsingSink> state
)

Spaces = \t* ;

Implementation

AsyncResult<Object?> fastParseSpaces$Async(State<ChunkedParsingSink> state) {
  final $0 = AsyncResult<Object?>();
  var $2 = 0;
  void $1() {
    while (true) {
      switch ($2) {
        case 0:
          final $5 = state.input;
          var $7 = false;
          while (state.pos < $5.end) {
            final $3 = $5.data.codeUnitAt(state.pos - $5.start);
            final $4 = $3 == 9 || $3 == 32;
            if (!$4) {
              $7 = true;
              break;
            }
            state.pos++;
          }
          if (!$7 && !$5.isClosed) {
            $5.sleep = true;
            $5.handle = $1;
            $2 = 0;
            return;
          }
          state.setOk(true);
          $0.isComplete = true;
          state.input.handle = $0.onComplete;
          $2 = -1;
          return;
        default:
          throw StateError('Invalid state: ${$2}');
      }
    }
  }

  $1();
  return $0;
}