summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rites/rite_of/precedence_of.ml63
1 files changed, 59 insertions, 4 deletions
diff --git a/lib/rites/rite_of/precedence_of.ml b/lib/rites/rite_of/precedence_of.ml
index bca6ca9..d777f68 100644
--- a/lib/rites/rite_of/precedence_of.ml
+++ b/lib/rites/rite_of/precedence_of.ml
@@ -24,10 +24,23 @@ let unclassified = max_int
(* Not a Normae citation. The Tabula distinguishes universal-calendar entries
(3, 7, 10) from proper-calendar ones (4, 8, 11), and nothing in
Celebration.t marks that distinction except [layer]. Same mechanism, and
- same naming, as Precedence_ef.{universal_layer,indult_prefix}. *)
+ same naming, as Precedence_ef.{universal_layer,indult_prefix}.
+
+ [universal_layer] itself is exported (hand-authored sanctoral data is
+ tagged with it) but [band] no longer tests [layer = universal_layer]
+ directly anywhere in this chain: every temporal-origin candidate
+ {!Rite_of.Temporal_of.temporal} constructs carries [layer = "temporal"]
+ unconditionally (temporal_of.ml, [build]'s own hardcoded ~layer), never
+ [universal_layer] -- so a positive "is this the universal layer" test
+ would silently exclude Trinity Sunday, Corpus Christi, Christ the King,
+ Mary Mother of God, Holy Family and the Baptism of the Lord, none of
+ which are proper-calendar in the sense the Tabula's own 4/8/11 mean.
+ Entries 3, 5 and 7 (all universal-or-temporal, never proper) therefore
+ test [not (is_proper layer)] instead -- true for both [universal_layer]
+ and ["temporal"], false only for a genuine ["proper:..."] candidate. Only
+ entries 4 and 8 test [is_proper] itself. *)
let universal_layer = "of-universal"
let proper_prefix = "proper:"
-let is_universal layer = String.equal layer universal_layer
let is_proper layer = String.starts_with ~prefix:proper_prefix layer
(* Days measured from Easter, so the Triduum and the Easter Octave are
@@ -78,6 +91,36 @@ let is_easter_octave_day ctx =
let o = easter_offset ctx in
o >= 1 && o <= 7
+(* Tabula II.6: "Dominicae temporis Nativitatis et dominicae 'per annum'".
+ The privileged Sundays (Advent, Lent, Easter) are entry 2 and are tested
+ first, so this branch sees only the remaining two seasons. *)
+let is_ordinary_sunday (ctx : Vocab_of.season Precedence.context) c =
+ ctx.weekday = Date.Sun
+ && (match ctx.season with
+ | Vocab_of.Christmas | Vocab_of.Ordinary_time -> true
+ | Vocab_of.Advent | Vocab_of.Lent | Vocab_of.Easter -> false)
+ && c.Precedence.origin = Precedence.Temporal
+
+(* Tabula II.9, three clauses. "Feriae Adventus a die 17 ad 24 decembris
+ inclusive" -- the late-Advent ferias, which outrank an obligatory memorial
+ where an ordinary Advent feria (entry 13) does not. *)
+let is_late_advent_feria (ctx : Vocab_of.season Precedence.context) =
+ ctx.season = Vocab_of.Advent
+ && Date.month ctx.date = 12
+ && Date.day ctx.date >= 17
+ && Date.day ctx.date <= 24
+
+(* "Dies infra octavam Nativitatis": 26-31 December. The Nativity itself
+ (25 December) is entry 2; 1 January is the Octave Day, a solemnity in the
+ sanctoral, not a feria. *)
+let is_nativity_octave_day (ctx : Vocab_of.season Precedence.context) =
+ Date.month ctx.date = 12 && Date.day ctx.date >= 26 && Date.day ctx.date <= 31
+
+(* "Feriae Quadragesimae". Ash Wednesday and the Holy Week ferias are entry 2
+ and are tested first. *)
+let is_lenten_feria (ctx : Vocab_of.season Precedence.context) =
+ ctx.season = Vocab_of.Lent
+
let band (ctx : Vocab_of.season Precedence.context)
(c : Vocab_of.rank Precedence.candidate) : int =
let temporal = c.Precedence.origin = Precedence.Temporal in
@@ -90,8 +133,20 @@ let band (ctx : Vocab_of.season Precedence.context)
|| is_holy_week_feria ctx
|| is_easter_octave_day ctx)
then 20 (* Tabula I.2 *)
- else if c.cel.rank = Vocab_of.Sollemnitas && is_universal layer then
- 30 (* Tabula I.3 *)
+ else if c.cel.rank = Vocab_of.Sollemnitas && not (is_proper layer) then
+ 30 (* Tabula I.3 -- universal or temporal-origin, never proper; see the
+ [is_proper] comment above for why this is not [is_universal] *)
else if c.cel.rank = Vocab_of.Sollemnitas && is_proper layer then
40 (* Tabula I.4 *)
+ else if c.cel.rank = Vocab_of.Festum && c.cel.subject = Subject.Lord
+ && not (is_proper layer) then 50 (* Tabula II.5 *)
+ else if is_ordinary_sunday ctx c then 60 (* Tabula II.6 *)
+ else if c.cel.rank = Vocab_of.Festum && not (is_proper layer) then
+ 70 (* Tabula II.7 -- BVM and saints; entry 5 already took subject = Lord *)
+ else if c.cel.rank = Vocab_of.Festum && is_proper layer then
+ 80 (* Tabula II.8 *)
+ else if
+ temporal
+ && (is_late_advent_feria ctx || is_nativity_octave_day ctx || is_lenten_feria ctx)
+ then 90 (* Tabula II.9 *)
else unclassified