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

Method normalize_fn_ref_value

codegraph-kernel/src/lua.rs:756–785  ·  view source on GitHub ↗

normalizeValue with LUA_SPEC's one transparent layer (expression_list fans out to named children).

(&mut self, v: Node<'t>, from: u32, depth: u32)

Source from the content-addressed store, hash-verified

754 /// normalizeValue with LUA_SPEC's one transparent layer (expression_list
755 /// fans out to named children).
756 fn normalize_fn_ref_value(&mut self, v: Node<'t>, from: u32, depth: u32) {
757 stack_guard!();
758 if depth > 4 {
759 return;
760 }
761 match v.kind() {
762 "identifier" => {
763 let name = self.text(v).to_string();
764 if name.is_empty() || is_stoplisted(&name) {
765 return;
766 }
767 let p = v.start_position();
768 self.fn_ref_cands.push(Cand {
769 from,
770 name,
771 line: p.row as u32 + 1,
772 column_byte: v.start_byte(),
773 row: p.row,
774 });
775 }
776 "expression_list" => {
777 let mut cursor = v.walk();
778 let kids: Vec<Node<'t>> = v.named_children(&mut cursor).collect();
779 for c in kids {
780 self.normalize_fn_ref_value(c, from, depth + 1);
781 }
782 }
783 _ => {}
784 }
785 }
786
787 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
788 stack_guard!();

Callers 1

maybe_capture_fn_refsMethod · 0.45

Calls 3

is_stoplistedFunction · 0.70
textMethod · 0.65
collectMethod · 0.45

Tested by

no test coverage detected