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

Function scan_field_assign

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

766/// Pairs collected as `lfield\0rfield`. Every byte position is a candidate
767/// start (JS advances one unit on failure — suffix starts included); matches
768/// resume at their end.
769fn scan_field_assign(s: &[u8], out: &mut Vec<String>) {
770 let mut pos = 0usize;
771 while pos < s.len() {
772 if !is_word(s[pos]) {
773 pos += 1;
774 continue;
775 }
776 match field_assign_at(s, pos) {
777 Some((lf, rf, end)) => {
778 let mut pair = bytes_to_string(&s[lf.0..lf.1]);
779 pair.push('\0');
780 pair.push_str(&bytes_to_string(&s[rf.0..rf.1]));
781 out.push(pair);
782 pos = end;
783 }
784 None => pos += 1,
785 }
786 }
787}
788
789#[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