diff options
| author | 2025-06-01 14:08:25 -0400 | |
|---|---|---|
| committer | 2025-06-01 14:08:25 -0400 | |
| commit | 8f5209fa095c2ed9114ce102b2f9b2cc90d66b13 (patch) | |
| tree | 4ec54815215a9a808be0ab9a2968159f144ba076 /src/Words.zig | |
| parent | Document "fat_offset" in README (diff) | |
| download | zg-8f5209fa095c2ed9114ce102b2f9b2cc90d66b13.tar.gz zg-8f5209fa095c2ed9114ce102b2f9b2cc90d66b13.tar.xz zg-8f5209fa095c2ed9114ce102b2f9b2cc90d66b13.zip | |
Add graphemeAtIndex + iterate before and after
That completes the set. I do think it's possible to bum a few more
cycles from the implementation, but, I'm not going to. It passes
the acceptance suite and that's what it needs to do.
Diffstat (limited to 'src/Words.zig')
| -rw-r--r-- | src/Words.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Words.zig b/src/Words.zig index 1707881..af82562 100644 --- a/src/Words.zig +++ b/src/Words.zig | |||
| @@ -124,12 +124,12 @@ pub fn reverseIterator(words: *const Words, slice: []const u8) ReverseIterator { | |||
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | /// Returns an iterator after the `word` in `slice`. | 126 | /// Returns an iterator after the `word` in `slice`. |
| 127 | pub fn iterateAfter(words: *const Words, slice: []const u8, word: Word) Iterator { | 127 | pub fn iterateAfterWord(words: *const Words, slice: []const u8, word: Word) Iterator { |
| 128 | return forwardFromIndex(words, slice, word.offset + word.len); | 128 | return forwardFromIndex(words, slice, word.offset + word.len); |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | /// Returns a reverse iterator before the `word` in `slice`. | 131 | /// Returns a reverse iterator before the `word` in `slice`. |
| 132 | pub fn iterateBefore(words: *const Words, slice: []const u8, word: Word) ReverseIterator { | 132 | pub fn iterateBeforeWord(words: *const Words, slice: []const u8, word: Word) ReverseIterator { |
| 133 | return reverseFromIndex(words, slice, word.offset); | 133 | return reverseFromIndex(words, slice, word.offset); |
| 134 | } | 134 | } |
| 135 | 135 | ||