parseMany method

  1. @override
Tuple1<List<int>>? parseMany(
  1. ParseState state
)
override

Implementation

@override
Tuple1<List<int>>? parseMany(ParseState state) {
  final list = <int>[];
  final source = state.data;
  final length = state.length;
  while (true) {
    final pos = state.pos;
    if (pos + 2 <= length) {
      final c = source.getUint16(pos, Endian.little);
      if (c >= 0x30 && c <= 0x39) {
        state.pos += 2;
        list.add(c - 0x30);
        continue;
      }
    }

    return Tuple1(list);
  }
}