diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-26 23:53:49 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-26 23:53:58 +0200 |
| commit | 90584d87e763789808329847c46dbaa8e22dca47 (patch) | |
| tree | 6b5e7c29adc0d1cf5fdfb71cfb8f097867bf04b5 /test/test_lectionary_of.ml | |
| parent | 9ebb06983b7a26db5564302253f2551dfbcf834e (diff) | |
| download | colitur-90584d87e763789808329847c46dbaa8e22dca47.tar.gz colitur-90584d87e763789808329847c46dbaa8e22dca47.zip | |
fix(citation): represent chapter-crossing verse ranges (W4)
Parse.verse_range's [last] endpoint gains an optional chapter
(Parse.verse_end: { chapter : int option; verse : verse_num }), so a
hyphen range whose two endpoints lie in different chapters
("1 John 1:5-2:2") can be represented at all. Rejected: a bare
[int option] living alongside [last] as a second field on
verse_range -- that would let 'a chapter with no verse' exist as a
constructible value.
parse_part now splits a part's leading "chapter:" at the FIRST
colon only (not every colon), so the verses side can itself carry a
second colon from a crossing range. parse_range detects a crossing
by checking whether the range's right-hand side contains ':', and
skips the same-chapter descending-range guard for that case (a later
chapter is always "ahead", whatever its own verse numbers are).
Handles the compound shape too -- a crossing range followed by
further, same-chapter verse references in the same comma list
("Matthew 9:35-10:1,5a,6-8") -- since those trailing pieces parse as
ordinary bare verses/ranges, unaffected by the preceding crossing.
Render's one_range renders a crossing [last] through the same
chapter_verse template one_part already uses for the part's own
leading "chapter:verses", so a style that reconfigures the
chapter/verse separator renders a crossing endpoint in that same
convention rather than a hardcoded ':'.
This closes the W4 known-wrong: 41 (now 49, after an intervening
Second-reading extraction) of the OF lectionary's citations printed
unconverted, every one this exact shape. test_citation_coverage_of.ml's
pinned residual is now empty and asserted exactly, over the full
1725-field data/of/lectionary.sexp population, including the round-trip
check (parse -> render -> parse structural equality). test_citation.ml
gains direct parse-suite cases for the basic crossing, the compound
shape, a mid-list crossing, a crossing with a sub-verse letter, and a
malformed-crossing rejection.
data/of/lectionary.sexp is regenerated via its own generator
(tools/bootstrap_lectionary_of.ml, whose own embedded header text is
updated to match); only comment lines change, confirmed by diff --
no lectionary entry differs. test_lectionary_of.ml's whole-file
SHA-256 pin is updated to match.
EF is unaffected: data/ef/ is untouched since v1.0.0, and a direct
byte comparison of `colitur day`/`colitur readings` for 2026, 1583
and 9999 against a git-worktree build of 1c0137d is identical on all
six outputs.
Diffstat (limited to 'test/test_lectionary_of.ml')
| -rw-r--r-- | test/test_lectionary_of.ml | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/test_lectionary_of.ml b/test/test_lectionary_of.ml index 706ee15..dc02176 100644 --- a/test/test_lectionary_of.ml +++ b/test/test_lectionary_of.ml @@ -178,7 +178,15 @@ let sha256_of_file path = don't transcribe it from generator stdout" discipline test_calendar_of_data.ml's own [test_sha256] already follows. *) let test_sha256_pinned () = - (* Fix wave I8 (final-review.md, 2026-08-25-colitur-of-phases-3-5): the + (* W4 (this task): header-only change, same discipline as I2 below -- + {!Colitur_citation.Parse.verse_end} closed the chapter-crossing gap, + so the residual the header's own COVERAGE (4) and the trailing + "Citations that do not parse" listing disclose went from 49 to 0. No + lectionary ENTRY changed (`git diff --stat` on this file shows only + comment lines). Re-derived with `sha256sum data/of/lectionary.sexp`, + same discipline. + + Fix wave I8 (final-review.md, 2026-08-25-colitur-of-phases-3-5): the hash changed again -- ONE genuine new entry this time ("of-nativity", the Christmas Day Mass hand-authored from OLM 1981; see test_coverage_2026's own citation), not header-only as the I2 change @@ -193,7 +201,7 @@ let test_sha256_pinned () = and test_citation_coverage_of.ml), and the header's "Epistle" wording is fixed to "First". Re-derived the same way, same discipline. *) Alcotest.(check string) "data/of/lectionary.sexp SHA-256" - "0d82069e879d8312943dee543aabc23208265534fcf7edd85c3d9137c2f4581d" (sha256_of_file lectionary_path) + "788ddc6d2d783286b6e64882a5372ae213cd5462c887e68aa2bea22388cdb4f7" (sha256_of_file lectionary_path) (* lectio's OWN of-lectionary.ini SHA-256, pinned inside data/of/ lectionary.sexp's own provenance header (tools/bootstrap_lectionary_of |
