miller/pkg/input
John Kerl f17276e0c4
Fix recutils parser for empty-valued fields with "+"-continuation (#2203)
The reader's three-pass pipeline (backslash-join -> fold "+"-continuations
onto raw lines -> split each folded line on ": ") broke on fields written
as bare "Name:" (colon, no trailing space, no value) whose value is
supplied entirely by following "+" lines -- the idiomatic recutils pattern
for e.g. a "%doc:" field. Folding the continuation onto the raw line
destroyed the ": " substring needed for the later split, so parsing such a
field crashed with a "missing field separator" error, even on well-formed
input.

Found by testing against GNU recutils' own tutorial example (books.rec,
from the manual's "A Little Example" page), now added as a fixture.
Restructured parsing to split each line into a key/value field before
folding continuations, so folding happens on the value rather than the
raw line; when the preceding value is empty, the continuation becomes the
value outright instead of gaining a spurious leading newline.

Adds regression coverage (test/cases/io-recutils/0006, 0007) and a docs
section covering the empty-value + continuation pattern.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 14:55:33 -04:00
..
constants.go Separate out ILineReader abstraction (#1504) 2024-02-24 22:07:56 -05:00
doc.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
fixed_width_splitter.go Some fixes for staticcheck (#2006) 2026-03-03 09:27:03 -05:00
fixed_width_splitter_test.go Add fixed width support for pprint reader (#1999) 2026-03-01 11:25:17 -05:00
line_reader.go Next batch of lint fixes (#2108) 2026-06-28 17:36:36 -04:00
pseudo_reader_gen.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
README.md Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
record_reader.go Exit 0 when skip-trivial-records is used and CSV/TSV ends with blank lines (#1535) (#2146) 2026-07-06 15:22:51 -04:00
record_reader_benchmark_test.go Replace list.List with Go slices (#1950) 2026-02-01 17:22:28 -05:00
record_reader_csv.go Exit 0 when skip-trivial-records is used and CSV/TSV ends with blank lines (#1535) (#2146) 2026-07-06 15:22:51 -04:00
record_reader_csvlite.go Fix dedupe-field-names clobbering values on ragged short rows (#1997) (#2144) 2026-07-06 15:20:25 -04:00
record_reader_dcf.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_reader_dkvp_nidx.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_reader_dkvp_test.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_reader_dkvpx.go DKVPX reader: honor --ifs and --ips instead of hard-coding comma and equals (#2172) 2026-07-06 17:37:07 -04:00
record_reader_dkvpx_test.go DKVPX reader: honor --ifs and --ips instead of hard-coding comma and equals (#2172) 2026-07-06 17:37:07 -04:00
record_reader_factory.go Add GNU recutils (.rec) as a Miller I/O format (#2201) 2026-07-15 11:51:16 -04:00
record_reader_json.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_reader_markdown.go The package version must match the major tag version (#1654) 2024-09-20 12:10:11 -04:00
record_reader_pprint.go Fix dedupe-field-names clobbering values on ragged short rows (#1997) (#2144) 2026-07-06 15:20:25 -04:00
record_reader_rec.go Fix recutils parser for empty-valued fields with "+"-continuation (#2203) 2026-07-15 14:55:33 -04:00
record_reader_rec_test.go Fix recutils parser for empty-valued fields with "+"-continuation (#2203) 2026-07-15 14:55:33 -04:00
record_reader_tsv.go Exit 0 when skip-trivial-records is used and CSV/TSV ends with blank lines (#1535) (#2146) 2026-07-06 15:22:51 -04:00
record_reader_xtab.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
record_reader_yaml.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
splitters.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00

Logic for parsing disk-file/standard-input byte streams into records.

There is one record-reader type per supported input file format, and a factory method.