aboutsummaryrefslogtreecommitdiff
path: root/lib/kernel/validate.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel/validate.ml')
-rw-r--r--lib/kernel/validate.ml15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/kernel/validate.ml b/lib/kernel/validate.ml
index 7be3425..c6501a9 100644
--- a/lib/kernel/validate.ml
+++ b/lib/kernel/validate.ml
@@ -20,7 +20,11 @@ let has_duplicate strings =
let rec go = function a :: (b :: _ as rest) -> a = b || go rest | _ -> false in
go sorted
-let run vocab ~year_start ~temporal ~anchors ~year =
+let run (rite : ('s, 'r) Rite.t) ~year =
+ let vocab = rite.Rite.vocab in
+ let year_start = rite.Rite.year_start in
+ let temporal = rite.Rite.temporal in
+ let anchors = rite.Rite.anchors in
let start = year_start year in
let stop =
(* [year_start (year + 1)] needs a date in civil year (year+1); at
@@ -98,8 +102,11 @@ let run vocab ~year_start ~temporal ~anchors ~year =
days;
let observed = List.rev !observed in
(* Season contiguity and completeness: the run-length-compressed sequence must
- equal vocab.seasons exactly -- all seasons, each in one unbroken run, in
- canonical order. No EF season can be empty in any year. *)
+ equal the rite's own [season_runs] exactly, in canonical order. This is
+ NOT necessarily [vocab.seasons] -- most rites have each season in one
+ unbroken run, but a rite may legitimately have one season appear in two
+ separate runs (the modern form's Ordinary Time does), so the expected
+ sequence is rite-supplied rather than derived from the vocabulary. *)
let compressed =
List.fold_left
(fun acc (_, t) ->
@@ -108,7 +115,7 @@ let run vocab ~year_start ~temporal ~anchors ~year =
[] observed
|> List.rev
in
- let expected = List.map vocab.Vocab.season_to_string vocab.Vocab.seasons in
+ let expected = List.map vocab.Vocab.season_to_string rite.Rite.season_runs in
if compressed <> expected then
fail start "seasons"
(Printf.sprintf "season runs %s; expected %s"