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:459–486  ·  view source on GitHub ↗
(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

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

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