diff options
Diffstat (limited to 'lib/citation/parse.mli')
| -rw-r--r-- | lib/citation/parse.mli | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/citation/parse.mli b/lib/citation/parse.mli index ea38d24..bc08728 100644 --- a/lib/citation/parse.mli +++ b/lib/citation/parse.mli @@ -15,7 +15,19 @@ actually carried. *) type verse_num = { n : int; suffix : string } -type verse_range = { first : verse_num; last : verse_num option } +(** The end of a verse range, when it needs to say more than a bare verse + number. [chapter = None] is the overwhelming common case (the range + ends in the same chapter its [part] already names); [chapter = Some c] + is a range whose hyphen crosses into a LATER chapter -- the shipped OF + lectionary really does cite this shape ([1 John 1:5-2:2]: the range + starts in chapter 1, the part's own [chapter], and ends at 2:2). A + dedicated record, rather than a bare [int option] living alongside + [verse_range.last] as a second field, so "a chapter with no verse" is + not a state this type can even represent -- see parse.ml's own + [parse_range] for how a hyphen range decides which shape it is. *) +type verse_end = { chapter : int option; verse : verse_num } + +type verse_range = { first : verse_num; last : verse_end option } type part = { chapter : int; verses : verse_range list } type t = { book : Book.id; parts : part list } |
