fastParse method

  1. @override
bool fastParse(
  1. State<StringReader> state
)
override

Parses the input and returns true if successful, false otherwise.

Implementation

@override
bool fastParse(State<StringReader> state) {
  final input = state.input;
  final pos = state.pos;
  if (pos < input.length) {
    final c = input.readChar(state.pos);
    for (var i = 0; i < chars.length; i++) {
      if (chars.codeUnitAt(i) == c) {
        state.pos += input.count;
        return true;
      }
    }
  }

  state.fail<Object?>(ErrorUnexpectedCharacter());
  return false;
}