parse method

  1. @override
Tuple1<E>? parse(
  1. ParseState state
)
override

Parses input data actively and produces the result.

Returns Tuple1 of the result if parsing was successful; otherwise returns null.

final r1 = p.parse(state);

Implementation

@override
Tuple1<E>? parse(ParseState state) {
  final pos = state.pos;
  if (pos + 2 <= state.length) {
    final ch = state.data.getUint16(pos, Endian.little);
    if (ch == c) {
      state.pos += 2;
      ws.fastParse(state);
      return _res;
    }
  }

  state.fail(_err, pos);
  state.pos = pos;
}