summaryrefslogtreecommitdiff
path: root/bin/main.ml
diff options
context:
space:
mode:
Diffstat (limited to 'bin/main.ml')
-rw-r--r--bin/main.ml37
1 files changed, 35 insertions, 2 deletions
diff --git a/bin/main.ml b/bin/main.ml
index eab41d8..6e3b03c 100644
--- a/bin/main.ml
+++ b/bin/main.ml
@@ -473,13 +473,32 @@ let readings_line ~lang ~sigla (d : (Rite_ef.Vocab_ef.season, Rite_ef.Vocab_ef.r
| Some c -> Colitur_citation.Sigla.format sigla c.Colitur_kernel.Citation.reference
| None -> "-"
in
+ (* The Second reading (OLM n. 67: a Sunday/solemnity's own three-reading
+ shape) is present-or-absent, not present-or-"-": unlike First/Gospel
+ ({!Colitur_kernel.Validate}'s "citations" check guarantees exactly one
+ of each on every day of every rite), a day may legitimately carry no
+ Second reading at all ([Rite.t.citation_shapes] for EF is
+ [[First; Gospel]] alone), and EF never carries one. So this is an
+ append-only field, the same discipline [name_suffix] below already
+ uses -- absent, it contributes the empty string and this row is
+ byte-identical to what it printed before the Second reading existed. *)
+ let second_suffix =
+ match
+ List.find_opt
+ (fun (c : Colitur_kernel.Citation.t) -> c.Colitur_kernel.Citation.part = Colitur_kernel.Citation.Second)
+ d.Colitur_kernel.Liturgical_day.citations
+ with
+ | Some c -> " | " ^ Colitur_citation.Sigla.format sigla c.Colitur_kernel.Citation.reference
+ | None -> ""
+ in
let slug_s = Colitur_kernel.Slug.to_string cel.Colitur_kernel.Celebration.slug in
let name = Colitur_naming.Lang.celebration lang slug_s in
let name_suffix = if name = slug_s then "" else " | " ^ name in
- Printf.printf "%s %s | %s | %s%s\n"
+ Printf.printf "%s %s | %s%s | %s%s\n"
(D.to_iso8601 d.Colitur_kernel.Liturgical_day.date)
slug_s
(part_ref Colitur_kernel.Citation.First)
+ second_suffix
(part_ref Colitur_kernel.Citation.Gospel)
name_suffix
@@ -736,13 +755,27 @@ let readings_line_of ~lang ~sigla
| Some c -> Colitur_citation.Sigla.format sigla c.Colitur_kernel.Citation.reference
| None -> "-"
in
+ (* Second reading: present-or-absent, not present-or-"-" -- see
+ [readings_line]'s own comment for the full reasoning (OLM n. 67, a
+ Sunday/solemnity's own three-reading shape; [Rite.t.citation_shapes]
+ is what actually distinguishes which OF days carry one). *)
+ let second_suffix =
+ match
+ List.find_opt
+ (fun (c : Colitur_kernel.Citation.t) -> c.Colitur_kernel.Citation.part = Colitur_kernel.Citation.Second)
+ d.Colitur_kernel.Liturgical_day.citations
+ with
+ | Some c -> " | " ^ Colitur_citation.Sigla.format sigla c.Colitur_kernel.Citation.reference
+ | None -> ""
+ in
let slug_s = Colitur_kernel.Slug.to_string cel.Colitur_kernel.Celebration.slug in
let name = observed_name_of ~lang cel slug_s in
let name_suffix = if name = slug_s then "" else " | " ^ name in
- Printf.printf "%s %s | %s | %s%s\n"
+ Printf.printf "%s %s | %s%s | %s%s\n"
(D.to_iso8601 d.Colitur_kernel.Liturgical_day.date)
slug_s
(part_ref Colitur_kernel.Citation.First)
+ second_suffix
(part_ref Colitur_kernel.Citation.Gospel)
name_suffix