The byte-indexed silent-clamp sub from ww was Hare's bytesub wearing the wrong name. Renamed accordingly; added the real rune-indexed sub per ref/hare/strings/sub.ha:30-42, with utf8bytelenbounded helper per :10. Both forms assert on start>end; bytesub also asserts end<=len(s). lib/getopt/getopt.ww:314 migrated to bytesub — its bi index is a byte offset over the arg's bytes. Tests cover ASCII parity, multi-byte UTF-8 (こんにちは / héllo) where rune index ≠ byte index, and a row contrasting identical args to make the distinction explicit. OOB-abort coverage deferred until the assert_aborts harness lands (#38). Selfhost combined.ww snapshots regenerated — they're bootstrap-stage inputs and would otherwise compile the old byte-wise sub. Two-arg default form omitted (#37, ww has no default parameter values).
24 KiB
24 KiB