strings: preserve UTF-8 and boundary invariants
This commit is contained in:
@@ -40,9 +40,9 @@ Signatures mirror Hare too, modulo:
|
||||
- `(T | U)` sum-typed parameters dispatch via `match` inside the
|
||||
callee. `strings.byteindex(haystack: str, needle: (str | rune))`,
|
||||
`bytes.index(s: []u8, needle: (u8 | []u8))`, and `rbyteindex`/
|
||||
`rindex` follow Hare's shape directly. The rune-indexed
|
||||
`strings.index` (rune-wise position) isn't shipped yet — we don't
|
||||
have UTF-8 rune iteration in the language stack.
|
||||
`rindex` follow Hare's shape directly. `strings.index`/`rindex` expose
|
||||
rune positions; `byteindex`/`rbyteindex` expose byte offsets. UTF-8
|
||||
iterators and both indexing axes are shipped and tested.
|
||||
|
||||
Don't ship a richer surface than Hare has. A documented subset is
|
||||
fine; an extension, rename, or convenience-wrapper is not — callers
|
||||
|
||||
Reference in New Issue
Block a user