Skip to content

CSV and TSV Conformance

Lanexio Parser implements RFC 4180 compliant CSV and TSV parsing with configurable delimiters, field quoting, and header-row detection. A single package (@lanexio/parser-grammar-csv) exports both parseCsv and parseTsv.

The conformance suite validates every clause of the RFC:

  • §2.1 — Basic format: header row, record separation, field counts
  • §2.3 — Header row: CSV_FLAG_HEADER detection and opt-in control
  • §2.4 — Multiple records: optional trailing newline
  • §2.5 — Whitespace: significant whitespace within quoted fields, insignificant elsewhere
  • §2.6 — Quoted fields: double-quote escaping, embedded commas, embedded line breaks
  • §2.7 — Double-quote within quoted field

610 tests pass across the CSV and TSV grammar paths.

AxisResult
never-throw0 throws across full corpus
well-formedcorpus WF = 0
losslesscorpus lossless = 0, byte-exact round-trip
conformance610/610, RFC 4180 covered