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

Method normalize_fn_ref_value

codegraph-kernel/src/lua.rs:878–907  ·  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

876 /// normalizeValue with LUA_SPEC's one transparent layer (expression_list
877 /// fans out to named children).
878 fn normalize_fn_ref_value(&mut self, v: Node<'t>, from: u32, depth: u32) {
879 stack_guard!();
880 if depth > 4 {
881 return;
882 }
883 match v.kind() {
884 "identifier" => {
885 let name = self.text(v).to_string();
886 if name.is_empty() || is_stoplisted(&name) {
887 return;
888 }
889 let p = v.start_position();
890 self.fn_ref_cands.push(Cand {
891 from,
892 name,
893 line: p.row as u32 + 1,
894 column_byte: v.start_byte(),
895 row: p.row,
896 });
897 }
898 "expression_list" => {
899 let mut cursor = v.walk();
900 let kids: Vec<Node<'t>> = v.named_children(&mut cursor).collect();
901 for c in kids {
902 self.normalize_fn_ref_value(c, from, depth + 1);
903 }
904 }
905 _ => {}
906 }
907 }
908
909 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
910 stack_guard!();

Callers 1

maybe_capture_fn_refsMethod · 0.45

Calls 5

pushMethod · 0.80
walkMethod · 0.80
is_stoplistedFunction · 0.70
textMethod · 0.65
collectMethod · 0.45

Tested by

no test coverage detected