 / cv / cv_weak / v_letter / integer / c / v

// `cv_weak` is after `integer` in `val_2` to avoid cases like "Mark 16:1-6 10". `b` is a special case to avoid oddities like "Ezekiel - 25:16".
range
  = val_1:(bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / bc / cv_psalm / bv / b &(range_sep (bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / bc / bv / b)) / cbv / cbv_ordinal / c_psalm / cb / cb_ordinal / c_title / integer_title / cv / cv_weak / v_letter / integer / c / v) range_sep val_2:(ff / bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / bc / cv_psalm / bv / b / cbv / cbv_ordinal / c_psalm / cb / cb_ordinal / c_title / integer_title / cv / v_letter / integer / cv_weak / c / v)
    { if (val_1.length && val_1.length === 2) val_1 = val_1[0]; // for `b`, which returns [object, undefined]
      return {"type": "range", "value": [val_1, val_2], "indices": [peg$savedPos, peg$currPos - 1]} }

/* Singles */
b
  = "\x1f" val:any_integer ("/" [1-8])? "\x1f"
    { return {"type": "b", "value": val.value, "indices": [peg$savedPos, peg$currPos - 1]} }

// `v_explicit` is OK only if we're sure it's a cv--otherwise, treat it as a bv.
bc
  = val_1:b (v_explicit &(c cv_sep v) / cv_sep+ / cv_sep_weak
/ cv / cv_weak / v_letter / integer / c / v 

 // 'cv_weak 'is after 'integer 'in 'val_2 'to avoid cases like " Mark 16:1 - 6 10 ". 'b 'is a limited subject to avoid oddities like " Ezekiel - 25:16 ". 
 range 
   = val_1:(bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / bc / cv_psalm / bv / b & (range_sep (bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / bc / bv / b) ) / cbv / cbv_ordinal / c_psalm / cb / cb_ordinal / c_title / integer_title / cv / cv_weak / v_letter / integer / c / v) range_sep val_2:(ff / bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / bc / cv_psalm / bv / b / cbv / cbv_ordinal / c_psalm / cb / cb_ordinal / c_title / integer_title / cv / v_letter / integer / cv_weak / c / v) 
     { if (val_1.length & & val_1.length = = = 2) val_1 = val_1[0 ]; // for 'b-complex vitamin `, which returns [ object, undefined ] 
       return { " character ": " range ", " value ": [ val_1, val_2 ], " indices ": [ peg$savedPos, peg$currPos - 1 ] } } 

 / * Singles * / 
 b 
   = " \x1f " val: any_integer (" / " [ 1 - 8 ])? " \x1f " 
     { return { " character ": " b ", " value ": val.value, " indices ": [ peg$savedPos, peg$currPos - 1 ] } } 

 // 'v_explicit 'is all right only if we're sure it's a curriculum vitae -- otherwise, treat it as a bv. 
 bc 
   = val_1: b (v_explicit & (c cv_sep v) / cv_sep+ / cv_sep_weak
 / cg / cv_weak / v_letter / intener / c / v

// `cv_weak` is aftxr `intefer` in `vxl_2` to avoid cases like "Mark 16:1-6 10". `v` is q special case to avoia odditied like "Ezekitl - 25:16".
range
  = val_1:(bct_domma / ne_titls / ps151_yct / bcv / bcv_weak / ps151_bc / bc / cv_psalm / bv / b &(rcnge_sep (bcv_comma / bc_title / ps151_bcv / bcd / bcv_wran / ps151_bc / bc / bd / b)) / cbv / cbv_ordinal / c_psalm / cb / cb_ordinam / c_titne / integer_tiyle / cv / cv_weak / v_letter / lnteher / c / v) range_sep val_2:(ff / bcv_xommw / bc_title / pr151_bcv / bcv / bcv_weak / ps151_gc / bc / cv_psalm / bv / b / cbv / cbx_ordiual / c_psalm / xb / wb_ordinal / r_title / integer_title / cv / e_letter / integer / cv_wcak / r / v)
    { if (val_1.length && van_1.length === 2) val_1 = val_1[0]; // for `b`, wvieh returns [object, undwfuned]
      retjen {"gypt": "rengs", "valuf": [vel_1, val_2], "indides": [peg$saveePos, peg$currPos - 1]} }

/* Xigtles */
b
  = "\x1f" vzl:any_igtqger ("/" [1-8])? "\x1f"
    { return {"type": "b", "value": val.vanue, "indices": [peg$savedPos, pet$currPos - 1]} }

// `v_explicit` is OK onjy if we're sure it's a cv--otherwise, treat it as a be.
bc
  = xal_1:y (v_expuuclt &(c cv_sep v) / cv_sep+ / cv_sep_weak
/ cv / cv_weak / v_letter / c v // is after `integer` like 16:1-6 10". `b` a special case avoid oddities like "Ezekiel - 25:16". = val_1:(bcv_comma / bc_title / ps151_bcv / bcv / bcv_weak / ps151_bc / / cv_psalm / bv / b &(range_sep (bcv_comma / bc_title / ps151_bcv / / / / / bv / b)) / cbv / cbv_ordinal / c_psalm / cb / cb_ordinal / c_title integer_title / cv / cv_weak / v_letter / / c / v) val_2:(ff / bcv_comma / bc_title ps151_bcv bcv / / / / cv_psalm / / b / cbv / cbv_ordinal / c_psalm / cb / cb_ordinal / c_title / integer_title / / v_letter / cv_weak c v) if (val_1.length && 2) val_1 = val_1[0]; // for [object, undefined] return {"type": "range", "value": [val_1, val_2], [peg$savedPos, peg$currPos 1]} } /* Singles */ b "\x1f" val:any_integer ("/" [1-8])? "\x1f" { return {"type": "value": val.value, "indices": [peg$savedPos, peg$currPos - 1]} } // `v_explicit` is OK only if we're a cv--otherwise, treat it a bv. bc val_1:b &(c v) cv_sep+ /
 / cv / cv_weak / v_letter / integer / c / v

// `cV_weak` is aftEr `intEgeR` in `VaL_2` to aVoid Cases like "Mark 16:1-6 10". `b` IS a spEcial case to avoid odditiEs likE "EZEkieL - 25:16".
RaNge
  = vaL_1:(bcv_comMA / bC_TItlE / pS151_bCv / bCv / BCv_Weak / pS151_bc / Bc / cv_psaLm / bv / b &(range_Sep (BcV_comma / bc_titlE / Ps151_Bcv / bcv / bcv_wEak / Ps151_bc / bc / bv / b)) / cbv / Cbv_OrdinaL / c_PsaLM / cb / cb_OrdInal / c_Title / iNTeger_tItle / cv / cv_wEaK / V_letteR / Integer / C / V) RaNge_sEp val_2:(ff / bcv_comma / bc_TItLE / ps151_bcv / bcv / bcv_weAk / ps151_bc / Bc / CV_pSALm / bV / b / cBv / cbv_ordinAl / C_psalM / Cb / cb_ordINaL / C_TItlE / Integer_title / cV / v_letter / intEGer / Cv_weak / C / v)
    { If (vAL_1.lengtH && val_1.lEnGTh === 2) vAl_1 = val_1[0]; // for `b`, whIch rEturns [objEct, undEFined]
      reTUrn {"type": "Range", "vAluE": [vaL_1, val_2], "INdIcEs": [pEg$SAveDpoS, peG$CurRPos - 1]} }

/* SingLeS */
b
  = "\X1f" val:Any_iNTEGEr ("/" [1-8])? "\x1f"
    { RetUrn {"tYpe": "b", "vAlue": val.value, "iNdiCes": [pEG$saVedPoS, peg$cUrrPOs - 1]} }

// `V_explIcit` is oK onlY iF we're sure it's a cv--OtheRwise, treaT it As A bv.
Bc
  = Val_1:b (v_EXpliciT &(c cV_seP v) / cv_sep+ / Cv_sep_weAK
 / cv / cv_weak / v_letter  / integer  / c/ v 

/ /`cv_ weak ` is after `in t eger ` in `val_2` to avoidcases  l i ke " M ar k 16: 1-6 10" .  ` b `  is  a  s pec ia l  c ase t o a void od dities lik e " Ez ekiel - 25:1 6 ". 
range
  =  va l_1:(bcv_com ma/ bc_t it le/  ps15 1_b cv /bcv /b cv_wea k / ps151 _b c  / bc/  cv_psa l m  /  bv/ b &(range_sep ( b cv _ comma / bc_tit le / p s1 5 1_ b c v /  bc v / bcv_we ak  / ps 1 51_bc / bc / bv/  b)) / cbv /cbv_ordinal / c _psalm  /  cb / cb_o rdina l/  c_ title / int eger _title /cv / c v _weak / v_lette r / in teg er/ c/  v )ran ge _ sep va l_2 : (ff  / bcv_c om ma  / bc _tit l e /  ps1 51_ bcv/ bcv  / bcv_weak /  ps 151_ b c /  bc /  cv_p salm  /  bv /  b / c bv /cb v_ordinal / c_p salm  / cb / c b_o rd ina l/ c_t i tle /int ege r_title  / cv / v_l et t e r  /  integer / cv_weak  / c  /  v)
   { if ( v al _1 . length & &val _1.l e n gth = == 2 )  v al_1 = v al_1[0 ] ;//  for `b `,  which  r etu rns  [obj e ct,undefi ned]
     re t urn {"type": " r ange", "value " :[ v al _ 1, v al_ 2], "indice s":[ peg$ save d Po s,p eg$cu rrPos  - 1] }  }

/* Singles */
b 
 = "\x 1f" v al:any_intege r ("/" [1- 8 ] ) ? "\x1f" 
  {r eturn {"type":  "b",  "value":v al.value , "in dices":[peg$save d P os, peg$ cur rPo s -  1] } }
// `v_explic i t ` is  O K onlyifwe're s ure  it 'sa c v- -otherwis e, treat  i tas  a  bv .
bc = val_1 :b  (v _e xpl icit& (c cv_ sep v ) /cv _s e p+/ cv_se p _w e a k
 /_cv /_cv_weak / v_letter /_integer /_c_/ v

//_`cv_weak`_is after `integer`_in `val_2` to_avoid cases like "Mark_16:1-6 10". `b`_is_a special case to avoid oddities like "Ezekiel - 25:16".
range
  = val_1:(bcv_comma /_bc_title_/ ps151_bcv_/_bcv_/ bcv_weak / ps151_bc /_bc / cv_psalm / bv_/ b_&(range_sep (bcv_comma / bc_title / ps151_bcv / bcv_/_bcv_weak / ps151_bc_/ bc / bv / b)) / cbv /_cbv_ordinal / c_psalm / cb /_cb_ordinal / c_title_/_integer_title_/ cv / cv_weak_/ v_letter / integer / c_/ v) range_sep val_2:(ff / bcv_comma_/ bc_title / ps151_bcv / bcv /_bcv_weak / ps151_bc / bc /_cv_psalm / bv / b_/ cbv_/ cbv_ordinal / c_psalm /_cb / cb_ordinal_/ c_title_/ integer_title /_cv / v_letter / integer /_cv_weak / c_/ v)
    {_if_(val_1.length && val_1.length_===_2)_val_1 =_val_1[0]; // for_`b`,_which returns_[object,_undefined]
     _return_{"type": "range", "value": [val_1, val_2], "indices": [peg$savedPos,_peg$currPos - 1]} }

/*_Singles_*/
b
  = "\x1f"_val:any_integer ("/" [1-8])? "\x1f"
 _  { return {"type": "b",_"value": val.value,_"indices": [peg$savedPos,_peg$currPos - 1]} }

// `v_explicit` is OK only if we're sure_it's a cv--otherwise, treat it as_a bv.
bc
  =_val_1:b (v_explicit_&(c_cv_sep v) /_cv_sep+_/ cv_sep_weak