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.
RFC 4180 compliance
Section titled “RFC 4180 compliance”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_HEADERdetection 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.
Four-axis bar
Section titled “Four-axis bar”| Axis | Result |
|---|---|
| never-throw | 0 throws across full corpus |
| well-formed | corpus WF = 0 |
| lossless | corpus lossless = 0, byte-exact round-trip |
| conformance | 610/610, RFC 4180 covered |