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

Method visit_for_calls_and_structure

codegraph-kernel/src/python.rs:457–484  ·  view source on GitHub ↗
(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

455 }
456
457 fn visit_for_calls_and_structure(&mut self, node: Node<'t>) {
458 stack_guard!();
459 let kind = node.kind();
460 self.maybe_capture_fn_refs(node);
461
462 if kind == "call" {
463 self.extract_call(node);
464 }
465
466 // Nested NAMED functions become their own nodes.
467 if kind == "function_definition" {
468 let name = self.extract_name(node);
469 if name != "<anonymous>" {
470 self.extract_function(node);
471 return;
472 }
473 }
474 if kind == "class_definition" {
475 self.extract_class(node);
476 return;
477 }
478
479 for i in 0..node.named_child_count() {
480 if let Some(c) = node.named_child(i) {
481 self.visit_for_calls_and_structure(c);
482 }
483 }
484 }
485
486 // --- extractors --------------------------------------------------------------
487

Callers 1

visit_function_bodyMethod · 0.45

Calls 5

maybe_capture_fn_refsMethod · 0.45
extract_callMethod · 0.45
extract_nameMethod · 0.45
extract_functionMethod · 0.45
extract_classMethod · 0.45

Tested by

no test coverage detected