Yield the final record when the input does not terminate it
A file whose last line has no trailing newline is common enough that failing on it is a real defect, and the tokenizer failed on it twice over, for two different reasons. The unquoted path retried a single time and then gave up, so it could not tell "the terminator has not been read yet" from "there is no terminator and never will be". It now loops until either a terminator appears or the reader is exhausted, and distinguishes the two reasons a read comes back empty: a full buffer is a genuine ShortBuffer, while an exhausted reader means whatever remains in the buffer is the record's last field. The quoted path failed for its own reason. `untilClosingQuote` withholds a closing quote that lands as the last byte in the buffer, since it cannot yet tell a "" escape from the end of the field. At end of input there is nothing left to wait for, so it now asks again instead of erroring, which is what lets an input end on a quoted field. A record ending in a column separator was also dropping its trailing empty field, yielding one field where `a,\n` yields two. Reaching the field state with an exhausted reader can only mean a column separator was just consumed -- a record that starts there is sent to eof instead -- so that case now emits the empty field it owes. Errors are preserved where they belong: a field longer than the buffer and an unclosed quoted field both still fail with ShortBuffer, each with a test of its own so that the new end-of-input paths cannot swallow a real error. Closes the TODO about the last line with and without a newline. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGYDXszLdpBxhkfqqHp17B