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

Source from the content-addressed store, hash-verified

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

Callers 1

visit_function_bodyMethod · 0.45

Calls 6

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

Tested by

no test coverage detected