MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / find_word

Function find_word

codegraph-kernel/src/cfnptr.rs:187–195  ·  view source on GitHub ↗

`\bWORD\b` occurrence search from `from`.

(s: &[u8], word: &[u8], mut from: usize)

Source from the content-addressed store, hash-verified

185}
186
187/// `\bWORD\b` occurrence search from `from`.
188fn find_word(s: &[u8], word: &[u8], mut from: usize) -> Option<usize> {
189 loop {
190 let t = find_bytes(s, word, from)?;
191 if boundary_before(s, t) && !is_word_at(s, t + word.len()) {
192 return Some(t);
193 }
194 from = t + 1;
195 }
196}
197
198// ---------- stripCommentsForRegex(src, 'c') ----------

Callers 3

scan_fnptr_typedefsFunction · 0.85
scan_fntype_typedefsFunction · 0.85
scan_inline_structsFunction · 0.85

Calls 4

find_bytesFunction · 0.85
boundary_beforeFunction · 0.85
is_word_atFunction · 0.85
lenMethod · 0.80

Tested by

no test coverage detected