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

Function scan_field_assign

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

FIELD_ASSIGN_RE: /(\w+)\s*(?:->|\.)\s*(\w+)\s*=\s*(\w+)\s*(?:->|\.)\s*(\w+)/g Pairs collected as `lfield\0rfield`. Every byte position is a candidate start (JS advances one unit on failure — suffix starts included); matches resume at their end.

(s: &[u8], out: &mut Vec<String>)

Source from the content-addressed store, hash-verified

784/// Pairs collected as `lfield\0rfield`. Every byte position is a candidate
785/// start (JS advances one unit on failure — suffix starts included); matches
786/// resume at their end.
787fn scan_field_assign(s: &[u8], out: &mut Vec<String>) {
788 let mut pos = 0usize;
789 while pos < s.len() {
790 if !is_word(s[pos]) {
791 pos += 1;
792 continue;
793 }
794 match field_assign_at(s, pos) {
795 Some((lf, rf, end)) => {
796 let mut pair = bytes_to_string(&s[lf.0..lf.1]);
797 pair.push('\0');
798 pair.push_str(&bytes_to_string(&s[rf.0..rf.1]));
799 out.push(pair);
800 pos = end;
801 }
802 None => pos += 1,
803 }
804 }
805}
806
807#[inline]

Callers 1

scan_fileFunction · 0.85

Calls 4

is_wordFunction · 0.85
field_assign_atFunction · 0.85
bytes_to_stringFunction · 0.85
lenMethod · 0.80

Tested by

no test coverage detected