Repository navigation
feat(stdlib): positional str search (find/rfind/starts_with_at/ends_with_at/trim_span) - #282
Merged
Merged
Conversation
…ith_at/trim_span) Byte offsets throughout: O(1) per call, O(n) streaming total, and backend-identical on every input (no char-counting divergence). Matches Rust str::find/rfind byte semantics; len()/slicing stay char-oriented by design (documented in stdlib.md). Layers: Rust natives + checker sigs (std + short spellings), C runtime twins + headers, AOT lowering map, e2e fixture + dual-engine parity entry, stdlib docs. find-loop line scan beats split on the 322KB bench (13ms vs 21ms x5) with zero substrings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Byte offsets throughout: O(1) per call, O(n) streaming total, backend-identical on every input (matches Rust
str::findbyte semantics;len()/slicing stay char-oriented by design, documented).Layers (all five, in lockstep)
str_mod) + registry (natives/mod.rs, std + short spellings)funcs.rs) + registry count/self-test updatesstrings.c/.h) + AOT lowering mapstr_find_test.zz+ registration + dual-engine parity entrydocs/stdlib.md(signatures, offset contract, examples)Notable decisions
trim_spanstrips Unicode White_Space explicitly on both backends (never the host trim — sidesteps the native/VM trim split)._at.Verify
zz_stdlib191/191 ✓, clippy + fmt cleansplit(13ms vs 21ms x5 on 322KB) with zero substrings allocated