parseText method

String? parseText(
  1. State<String> state
)

Text = $TextChar* ;

Implementation

String? parseText(State<String> state) {
  String? $0;
  // $TextChar*
  final $2 = state.pos;
  final $3 = state.ignoreErrors;
  state.ignoreErrors = true;
  while (true) {
    // @inline TextChar = @verify('Unexpected character', [^"\n\r]) ;
    // @verify('Unexpected character', [^"\n\r])
    final $7 = state.pos;
    int? $5;
    // [^"\n\r]
    if (state.pos < state.input.length) {
      final $9 = state.input.runeAt(state.pos);
      final $10 = !($9 < 13 ? $9 == 10 : $9 <= 13 || $9 == 34);
      if ($10) {
        state.pos += $9 > 0xffff ? 2 : 1;
        state.setOk(true);
        $5 = $9;
      } else {
        state.fail(const ErrorUnexpectedCharacter());
      }
    } else {
      state.fail(const ErrorUnexpectedEndOfInput());
    }
    if (state.ok) {
      // ignore: unused_local_variable
      final $$ = $5!;
      final $6 = (() => $$ != _separatorChar)();
      if (!$6) {
        state.fail(ErrorMessage($7 - state.pos, 'Unexpected character'));
        state.backtrack($7);
      }
    }
    if (!state.ok) {
      break;
    }
  }
  state.ignoreErrors = $3;
  state.setOk(true);
  if (state.ok) {
    $0 = state.input.substring($2, state.pos);
  }
  return $0;
}