parse method

  1. @override
Result<String>? parse(
  1. State<StringReader> state
)
override

Implementation

@override
Result<String>? parse(State<StringReader> state) {
  final input = state.input;
  final pos = state.pos;
  while (state.pos < input.length) {
    final c = input.readChar(state.pos);
    if (!f(c)) {
      break;
    }

    state.pos += input.count;
  }

  return state.pos != pos
      ? const Result('')
      : state.fail(const ErrorUnexpectedCharacter());
}