parseRows method
Rows = v:@list1(Row, RowEnding ↑ v:Row) ;
Implementation
List<List<String>>? parseRows(State<String> state) {
List<List<String>>? $0;
// v:@list1(Row, RowEnding ↑ v:Row)
final $2 = <List<String>>[];
List<String>? $3;
// Row
// Row
$3 = parseRow(state);
if (state.ok) {
$2.add($3!);
final $5 = state.ignoreErrors;
state.ignoreErrors = true;
while (true) {
List<String>? $4;
// RowEnding ↑ v:Row
final $11 = state.pos;
var $9 = true;
final $10 = state.ignoreErrors;
// @inline RowEnding = Eol !@eof() ;
// Eol !@eof()
final $12 = state.pos;
// Eol
fastParseEol(state);
if (state.ok) {
final $13 = state.pos;
if (state.pos >= state.input.length) {
state.setOk(true);
} else {
state.fail(const ErrorExpectedEndOfInput());
}
if (state.ok) {
final length = $13 - state.pos;
state.fail(switch (length) {
0 => const ErrorUnexpectedInput(0),
-1 => const ErrorUnexpectedInput(-1),
-2 => const ErrorUnexpectedInput(-2),
_ => ErrorUnexpectedInput(length)
});
state.backtrack($13);
} else {
state.setOk(true);
}
}
if (!state.ok) {
state.backtrack($12);
}
if (state.ok) {
$9 = false;
state.ignoreErrors = false;
state.setOk(true);
if (state.ok) {
List<String>? $8;
// Row
$8 = parseRow(state);
if (state.ok) {
$4 = $8;
}
}
}
if (!state.ok) {
if (!$9) {
state.isRecoverable = false;
}
state.backtrack($11);
}
state.ignoreErrors = $10;
if (!state.ok) {
break;
}
$2.add($4!);
}
state.ignoreErrors = $5;
}
state.setOk($2.isNotEmpty);
if (state.ok) {
$0 = $2;
}
return $0;
}