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

Method normalize_fn_ref_value

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

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