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

Function scan_field_assign

codegraph-kernel/src/cfnptr.rs:796–814  ·  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

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

Callers 1

scan_fileFunction · 0.85

Calls 5

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

Tested by

no test coverage detected