pub fn subscript_bound_classify(t: &str, arr: &[String]) -> SubscriptBoundExpand description
!!! WARNING: RUST-ONLY HELPER !!!
Classify one subscript operand against arr — see SubscriptBound.
c:Src/params.c getindex — a bound with a search-flag subscript
((r)pat/(i)pat) yields the INDEX of the match (the *inv/*w path),
not the value: ${a[(r)3,(r)5]} slices between the matched positions.
getarg returns the value for r/R but the index for i/I. r is a
FORWARD first-match (c:1411 down = 0), R a REVERSE last-match (c:1416
down = 1), so map r→i / R→I to get the matching index in the SAME
direction — preserving forward/reverse for duplicate matches and the
no-match returns (forward no-match → len+1, reverse → 0).