aboutsummaryrefslogtreecommitdiff
path: root/lib/citation/parse.mli
blob: 3d1053c2854f34e19b38ce7914fe8bb3d0ea6645 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(* SPDX-License-Identifier: AGPL-3.0-or-later *)

(** A citation, parsed. Never raises; an unrecognised string is an [Error]
    naming what could not be read, never a silent pass-through.

    The shape is a book and a LIST of chapter-parts, not one chapter and one
    verse range, because the shipped data really does cite across chapters
    ([John 18:1-40; 19:1-42]) and really does list disjoint verse ranges
    within a chapter ([Dan 13:1-9, 15-17, 19-30, 33-62]). *)

type verse_range = { first : int; last : int option }
type part = { chapter : int; verses : verse_range list }
type t = { book : Book.id; parts : part list }

val parse : string -> (t, string) result