mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-22 07:30:43 +00:00
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>
31 lines
596 B
Text
31 lines
596 B
Text
# -*- mode: rec -*-
|
|
# Source: https://www.gnu.org/software/recutils/manual/html_node/A-Little-Example.html
|
|
|
|
%rec: Book
|
|
%mandatory: Title
|
|
%type: Location enum loaned home unknown
|
|
%doc:
|
|
+ A book in my personal collection.
|
|
|
|
Title: GNU Emacs Manual
|
|
Author: Richard M. Stallman
|
|
Publisher: FSF
|
|
Location: home
|
|
|
|
Title: The Colour of Magic
|
|
Author: Terry Pratchett
|
|
Location: loaned
|
|
|
|
Title: Mio Cid
|
|
Author: Anonymous
|
|
Location: home
|
|
|
|
Title: chapters.gnu.org administration guide
|
|
Author: Nacho Gonzalez
|
|
Author: Jose E. Marchesi
|
|
Location: unknown
|
|
|
|
Title: Yeelong User Manual
|
|
Location: home
|
|
|
|
# End of books.rec
|