parseRow method

List<String>? parseRow(
  1. State<String> state
)

@event Row = @list1(Field, ',' ↑ v:Field) ;

Implementation

List<String>? parseRow(State<String> state) {
  beginEvent(CsvParserEvent.rowEvent);
  List<String>? $0;
  // @list1(Field, ',' ↑ v:Field)
  final $2 = <String>[];
  String? $3;
  // Field
  beginEvent(CsvParserEvent.fieldEvent);
  // @event @inline Field = String / Text ;
  // String
  // String
  $3 = parseString(state);
  if (!state.ok && state.isRecoverable) {
    // Text
    // Text
    $3 = parseText(state);
  }
  $3 = endEvent<String>(CsvParserEvent.fieldEvent, $3, state.ok);
  if (state.ok) {
    $2.add($3!);
    final $5 = state.ignoreErrors;
    state.ignoreErrors = true;
    while (true) {
      String? $4;
      // ',' ↑ v:Field
      final $13 = state.pos;
      var $11 = true;
      final $12 = state.ignoreErrors;
      const $14 = ',';
      final $15 = state.pos < state.input.length &&
          state.input.codeUnitAt(state.pos) == 44;
      if ($15) {
        state.pos++;
        state.setOk(true);
      } else {
        state.fail(const ErrorExpectedTags([$14]));
      }
      if (state.ok) {
        $11 = false;
        state.ignoreErrors = false;
        state.setOk(true);
        if (state.ok) {
          String? $10;
          beginEvent(CsvParserEvent.fieldEvent);
          // @event @inline Field = String / Text ;
          // String
          // String
          $10 = parseString(state);
          if (!state.ok && state.isRecoverable) {
            // Text
            // Text
            $10 = parseText(state);
          }
          $10 = endEvent<String>(CsvParserEvent.fieldEvent, $10, state.ok);
          if (state.ok) {
            $4 = $10;
          }
        }
      }
      if (!state.ok) {
        if (!$11) {
          state.isRecoverable = false;
        }
        state.backtrack($13);
      }
      state.ignoreErrors = $12;
      if (!state.ok) {
        break;
      }
      $2.add($4!);
    }
    state.ignoreErrors = $5;
  }
  state.setOk($2.isNotEmpty);
  if (state.ok) {
    $0 = $2;
  }
  $0 = endEvent<List<String>>(CsvParserEvent.rowEvent, $0, state.ok);
  return $0;
}