aboutsummaryrefslogtreecommitdiff
path: root/internal/calendar/types.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/calendar/types.go')
-rw-r--r--internal/calendar/types.go40
1 files changed, 34 insertions, 6 deletions
diff --git a/internal/calendar/types.go b/internal/calendar/types.go
index 77d57ab..0ccef8b 100644
--- a/internal/calendar/types.go
+++ b/internal/calendar/types.go
@@ -4,16 +4,44 @@ package calendar
import "time"
-type Rank int
+// Rank is a form-specific rank token. Ordinary Form uses the values below;
+// the Extraordinary Form uses its own (class-1..class-4, commemoration, ferial).
+// Each form's precedence interprets its own vocabulary.
+type Rank string
const (
- RankFerial Rank = iota // ordinary weekday
- RankOptional // optional memorial
- RankMemorial // obligatory memorial
- RankFeast
- RankSolemnity
+ // Ordinary Form ranks.
+ RankFerial Rank = "ferial" // ordinary weekday
+ RankOptional Rank = "optional" // optional memorial
+ RankMemorial Rank = "memorial" // obligatory memorial
+ RankFeast Rank = "feast" //
+ RankSolemnity Rank = "solemnity" //
+
+ // Extraordinary Form ranks (1960 Code of Rubrics): I-IV class + commemoration.
+ RankClass1 Rank = "class-1"
+ RankClass2 Rank = "class-2"
+ RankClass3 Rank = "class-3"
+ RankClass4 Rank = "class-4"
+ RankCommemoration Rank = "commemoration"
)
+// ofRankOrder orders the Ordinary Form ranks for the few `<` comparisons in the
+// OF path (ferial lowest, solemnity highest). Unknown/empty → 0 (ferial-level).
+func ofRankOrder(r Rank) int {
+ switch r {
+ case RankSolemnity:
+ return 4
+ case RankFeast:
+ return 3
+ case RankMemorial:
+ return 2
+ case RankOptional:
+ return 1
+ default:
+ return 0
+ }
+}
+
type Class int
const (