parse.bend checks
raw source on the hub · import 0x871fbaa34668931fc27fda009a9da24e/parse.bend as Parse
2 imports
import Base import ./books.bend as Books
Types
type BookSt source · line 35 · raw
Data
BookCheckBookSt
BookDecide@stop:Bool -> BookSt
BookTakeBookSt
type DigSt source · line 68 · raw
Data
DigCheckDigSt
DigDecide@is_d:Bool -> DigSt
DigTakeDigSt
type RangeKind source · line 146 · raw
Data
SingleRangeKind
ChapterRangeKind
SameChapterRangeKind
ChapterRangeRangeKind
type ParseErr source · line 152 · raw
Data
EmptyParseErr
BadBookParseErr
BadFormatParseErr
BadNumberParseErr
CapChapter@book:String -> @max:U32 -> @got:U32 -> ParseErr
CapVerse@book:String -> @chapter:U32 -> @max:U32 -> @got:U32 -> ParseErr
ReversedParseErr
type Parsed source · line 161 · raw
Data
Parsed@canonical:String -> @display:String -> @book:String -> @chapter:U32 -> @verse:Maybe<&2, U32> -> @end_chapter:U32 -> @end_verse:Maybe<&2, U32> -> @kind:RangeKind -> Parsed
type DecSt source · line 537 · raw
Data
Single recursive decoder — Maybe results passed as DecSt fields (no computed match)
DecCopyDecSt
DecClass@c:Char -> @is_pct:Bool -> @is_plus:Bool -> DecSt
DecPctDecSt
DecNib1@m:Maybe<&2, U32> -> @spill:Char -> DecSt
DecHi@hi:U32 -> DecSt
DecNib2@hi:U32 -> @m:Maybe<&2, U32> -> @spill:Char -> DecSt
DecApply@hi:U32 -> @lo:U32 -> DecSt
type CutSt source · line 603 · raw
Data
CutCheckCutSt
CutDecide@stop:Bool -> CutSt
CutTakeCutSt
Definitions
def char1 source · line 4 · raw
@+c:Char -> String
def is_book_stop_flags source · line 7 · raw
@+has_letter:Bool -> @is_d:Bool -> @is_a:Bool -> @is_s:Bool -> Bool
def is_book_stop source · line 22 · raw
@+has_letter:Bool -> @+c:Char -> Bool
def next_has_letter_go source · line 25 · raw
@has_letter:Bool -> @is_a:Bool -> Bool
def next_has_letter source · line 32 · raw
@+has_letter:Bool -> @+c:Char -> Bool
def take_book_go source · line 40 · raw
@fuel:Nat -> @st:BookSt -> @rest:String -> @acc:String -> @+has_letter:Bool -> Pair(String, String)
def take_book source · line 65 · raw
@+s:String -> Pair(String, String)
def take_digits_go source · line 73 · raw
@fuel:Nat -> @st:DigSt -> @rest:String -> @acc:String -> Pair(String, String)
def take_digits source · line 98 · raw
@+s:String -> Pair(String, String)
def is_colon_or_dot source · line 101 · raw
@+c:Char -> Bool
def drop_head source · line 104 · raw
@s:String -> String
def drop_cv_sep_go source · line 111 · raw
@+s:String -> @drop:Bool -> String
def drop_cv_sep source · line 118 · raw
@+s:String -> String
def drop_dash_go source · line 125 · raw
@+s:String -> @drop:Bool -> String
def drop_dash source · line 132 · raw
@+s:String -> String
def is_dash_head source · line 139 · raw
@s:String -> Bool
def require_u32_nz source · line 173 · raw
@n:U32 -> @z:Bool -> Result<&1, &1, ParseErr, U32>
def require_u32_go source · line 180 · raw
@m:Maybe<&2, U32> -> Result<&1, &1, ParseErr, U32>
def require_u32 source · line 187 · raw
@s:String -> Result<&1, &1, ParseErr, U32>
def check_ch_le source · line 190 · raw
@+book:String -> @+ch:U32 -> @+max:U32 -> @ok:Bool -> Result<&1, &1, ParseErr, Unit>
def check_ch_go source · line 197 · raw
@+book:String -> @+ch:U32 -> @m:Maybe<&2, U32> -> Result<&1, &1, ParseErr, Unit>
def check_ch source · line 204 · raw
@+book:String -> @+ch:U32 -> Result<&1, &1, ParseErr, Unit>
def check_vs_le source · line 207 · raw
@+book:String -> @+ch:U32 -> @+v:U32 -> @+max:U32 -> @ok:Bool -> Result<&1, &1, ParseErr, Unit>
def check_vs_go source · line 214 · raw
@+book:String -> @+ch:U32 -> @+v:U32 -> @m:Maybe<&2, U32> -> Result<&1, &1, ParseErr, Unit>
def check_vs source · line 221 · raw
@+book:String -> @+ch:U32 -> @+v:U32 -> Result<&1, &1, ParseErr, Unit>
def fmt_osis_part source · line 224 · raw
@+book:String -> @+ch:U32 -> @v:Maybe<&2, U32> -> String
def fmt_same_canonical source · line 234 · raw
@+book:String -> @+ch:U32 -> @a:U32 -> @ev:Maybe<&2, U32> -> String
def fmt_canonical_same source · line 241 · raw
@+book:String -> @+ch:U32 -> @v:Maybe<&2, U32> -> @ev:Maybe<&2, U32> -> String
def fmt_canonical source · line 248 · raw
@+book:String -> @+ch:U32 -> @+v:Maybe<&2, U32> -> @+ech:U32 -> @+ev:Maybe<&2, U32> -> @+kind:RangeKind -> String
def fmt_display_verse source · line 259 · raw
@+name:String -> @+ch:U32 -> @v:Maybe<&2, U32> -> String
def fmt_display_same2 source · line 269 · raw
@+name:String -> @+ch:U32 -> @a:U32 -> @ev:Maybe<&2, U32> -> String
def fmt_display_same source · line 282 · raw
@+name:String -> @+ch:U32 -> @v:Maybe<&2, U32> -> @ev:Maybe<&2, U32> -> String
def fmt_display_with source · line 289 · raw
@+name:String -> @+ch:U32 -> @+v:Maybe<&2, U32> -> @+ech:U32 -> @+ev:Maybe<&2, U32> -> @+kind:RangeKind -> String
def fmt_display source · line 303 · raw
@+book:String -> @+ch:U32 -> @+v:Maybe<&2, U32> -> @+ech:U32 -> @+ev:Maybe<&2, U32> -> @+kind:RangeKind -> String
def mk_parsed source · line 306 · raw
@+book:String -> @+ch:U32 -> @+v:Maybe<&2, U32> -> @+ech:U32 -> @+ev:Maybe<&2, U32> -> @+kind:RangeKind -> Parsed
def finish_ch_ok source · line 313 · raw
@+book:String -> @+ch:U32 -> @+ech:U32 -> @+kind:RangeKind -> @rev:Bool -> Result<&1, &1, ParseErr, Parsed>
def finish_ch_after source · line 320 · raw
@+book:String -> @+ch:U32 -> @+ech:U32 -> @+kind:RangeKind -> @r:Result<&1, &1, ParseErr, Unit> -> Result<&1, &1, ParseErr, Parsed>
def finish_ch_match source · line 327 · raw
@+book:String -> @+ch:U32 -> @+ech:U32 -> @+kind:RangeKind -> @r:Result<&1, &1, ParseErr, Unit> -> Result<&1, &1, ParseErr, Parsed>
def finish_ch source · line 334 · raw
@+book:String -> @+ch:U32 -> @+ech:U32 -> @+kind:RangeKind -> Result<&1, &1, ParseErr, Parsed>
def finish_vs_end_ok source · line 337 · raw
@+book:String -> @+ch:U32 -> @+vn:U32 -> @+en:U32 -> @rev:Bool -> Result<&1, &1, ParseErr, Parsed>
def finish_vs_end source · line 344 · raw
@+book:String -> @+ch:U32 -> @+vn:U32 -> @+en:U32 -> @r:Result<&1, &1, ParseErr, Unit> -> Result<&1, &1, ParseErr, Parsed>
def finish_vs_ev source · line 351 · raw
@+book:String -> @+ch:U32 -> @+vn:U32 -> @ev:Maybe<&2, U32> -> Result<&1, &1, ParseErr, Parsed>
def finish_vs_after_vn source · line 358 · raw
@+book:String -> @+ch:U32 -> @+vn:U32 -> @ev:Maybe<&2, U32> -> @r:Result<&1, &1, ParseErr, Unit> -> Result<&1, &1, ParseErr, Parsed>
def finish_vs_match source · line 365 · raw
@+book:String -> @+ch:U32 -> @+vn:U32 -> @ev:Maybe<&2, U32> -> @r:Result<&1, &1, ParseErr, Unit> -> Result<&1, &1, ParseErr, Parsed>
def finish_vs source · line 372 · raw
@+book:String -> @+ch:U32 -> @+vn:U32 -> @ev:Maybe<&2, U32> -> Result<&1, &1, ParseErr, Parsed>
def parse_after_verse_ev source · line 375 · raw
@+book:String -> @+ch:U32 -> @+vn:U32 -> @r:Result<&1, &1, ParseErr, U32> -> Result<&1, &1, ParseErr, Parsed>
def parse_after_verse_digits source · line 382 · raw
@+book:String -> @+ch:U32 -> @+vn:U32 -> @pair:Pair(String, String) -> Result<&1, &1, ParseErr, Parsed>
def parse_after_verse_num_go source · line 387 · raw
@+book:String -> @+ch:U32 -> @+vn:U32 -> @+rest:String -> @empty:Bool -> Result<&1, &1, ParseErr, Parsed>
def parse_after_verse_num_trim source · line 394 · raw
@+book:String -> @+ch:U32 -> @+vn:U32 -> @+r:String -> Result<&1, &1, ParseErr, Parsed>
def parse_after_verse_num source · line 397 · raw
@+book:String -> @+ch:U32 -> @+vn:U32 -> @+rest:String -> Result<&1, &1, ParseErr, Parsed>
def parse_verse_branch_num source · line 400 · raw
@+book:String -> @+ch:U32 -> @+rest2:String -> @r:Result<&1, &1, ParseErr, U32> -> Result<&1, &1, ParseErr, Parsed>
def parse_verse_branch_pair source · line 407 · raw
@+book:String -> @+ch:U32 -> @pair:Pair(String, String) -> Result<&1, &1, ParseErr, Parsed>
def parse_verse_branch source · line 412 · raw
@+book:String -> @+ch:U32 -> @+rest:String -> Result<&1, &1, ParseErr, Parsed>
def parse_chapter_range_num source · line 415 · raw
@+book:String -> @+ch:U32 -> @r:Result<&1, &1, ParseErr, U32> -> Result<&1, &1, ParseErr, Parsed>
def parse_chapter_range_pair source · line 422 · raw
@+book:String -> @+ch:U32 -> @pair:Pair(String, String) -> Result<&1, &1, ParseErr, Parsed>
def parse_chapter_range_branch source · line 427 · raw
@+book:String -> @+ch:U32 -> @+rest:String -> Result<&1, &1, ParseErr, Parsed>
def parse_after_chapter_sep_go source · line 430 · raw
@+book:String -> @+ch:U32 -> @+rest:String -> @empty:Bool -> @dash:Bool -> Result<&1, &1, ParseErr, Parsed>
def parse_after_chapter_sep_trim source · line 441 · raw
@+book:String -> @+ch:U32 -> @+r:String -> Result<&1, &1, ParseErr, Parsed>
def parse_after_chapter_sep source · line 444 · raw
@+book:String -> @+ch:U32 -> @+rest:String -> Result<&1, &1, ParseErr, Parsed>
def parse_tail_num source · line 447 · raw
@+book:String -> @+rest0:String -> @r:Result<&1, &1, ParseErr, U32> -> Result<&1, &1, ParseErr, Parsed>
def parse_tail_pair source · line 454 · raw
@+book:String -> @pair:Pair(String, String) -> Result<&1, &1, ParseErr, Parsed>
def parse_tail source · line 459 · raw
@+book:String -> @+tail:String -> Result<&1, &1, ParseErr, Parsed>
def parse_passage_book source · line 462 · raw
@+rest:String -> @m:Maybe<&2, String> -> Result<&1, &1, ParseErr, Parsed>
def parse_passage_pair source · line 469 · raw
@pair:Pair(String, String) -> Result<&1, &1, ParseErr, Parsed>
def parse_passage_go source · line 474 · raw
@+s0:String -> @empty:Bool -> Result<&1, &1, ParseErr, Parsed>
def hex_digit_lo source · line 484 · raw
@code:U32 -> @ok:Bool -> Maybe<&2, U32>
def hex_digit_up source · line 491 · raw
@code:U32 -> @ok:Bool -> Maybe<&2, U32>
def hex_digit_low source · line 498 · raw
@code:U32 -> @ok:Bool -> Maybe<&2, U32>
def hex_nibble_af source · line 505 · raw
@+code:U32 -> @dig:Maybe<&2, U32> -> Maybe<&2, U32>
def hex_nibble_az source · line 512 · raw
@+code:U32 -> @dig:Maybe<&2, U32> -> Maybe<&2, U32>
def hex_nibble_from_code source · line 522 · raw
@+code:U32 -> Maybe<&2, U32>
def hex_nibble source · line 528 · raw
@+c:Char -> Maybe<&2, U32>
def hex_byte source · line 533 · raw
@hi:U32 -> @lo:U32 -> U32
def url_decode_go source · line 546 · raw
@fuel:Nat -> @st:DecSt -> @rest:String -> @acc:String -> String
def url_decode source · line 600 · raw
@+s:String -> String
def is_query_or_hash source · line 608 · raw
@+c:Char -> Bool
def take_until_qh_go source · line 611 · raw
@fuel:Nat -> @st:CutSt -> @rest:String -> @acc:String -> String
def strip_query source · line 636 · raw
@+s:String -> String
def take_until_slash_go source · line 639 · raw
@fuel:Nat -> @st:CutSt -> @rest:String -> @acc:String -> String
def last_path_segment source · line 664 · raw
@+s:String -> String
def parse_passage_trim source · line 675 · raw
@+s0:String -> Result<&1, &1, ParseErr, Parsed>
def parse_passage source · line 678 · raw
@+input:String -> Result<&1, &1, ParseErr, Parsed>
def looks_like_url source · line 682 · raw
@+s:String -> Bool
def extract_url_ref source · line 685 · raw
@+s:String -> String
def parse_any_go source · line 688 · raw
@+s:String -> @is_url:Bool -> Result<&1, &1, ParseErr, Parsed>
def parse_any_trim source · line 695 · raw
@+s:String -> Result<&1, &1, ParseErr, Parsed>
def parse_any source · line 698 · raw
@+input:String -> Result<&1, &1, ParseErr, Parsed>
def err_msg source · line 702 · raw
@e:ParseErr -> String
def show_ok source · line 728 · raw
@+canonical:String -> @+display:String -> IO(Unit)
def show_result source · line 735 · raw
@r:Result<&1, &1, ParseErr, Parsed> -> IO(Unit)
def join_args source · line 749 · raw
@xs:List<&1, String> -> String
def usage source · line 758 · raw
IO(Unit)
def run_query source · line 761 · raw
@+q:String -> IO(Unit)
def run_args source · line 764 · raw
@xs:List<&1, String> -> IO(Unit)
def main source · line 771 · raw
IO(Unit)