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

Method extract_call

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

Source from the content-addressed store, hash-verified

627 // --- extractCall (3684; generic tail 4313, 4518-4532, 4572-4580) ------
628
629 fn extract_call(&mut self, node: Node<'t>) {
630 if self.stack.is_empty() {
631 return;
632 }
633 let caller_row = self.top_row();
634 // The `function` field is NULL in this grammar → namedChild(0) (the
635 // `name:` child). Member branch never fires (dot/method_index aren't
636 // in its type list) → raw source text, then the paren-conversion.
637 let func = node
638 .child_by_field_name("function")
639 .or_else(|| node.named_child(0));
640 let Some(func) = func else { return };
641 let mut callee: &str = self.text(func);
642 if let Some(caps) = util::paren_conversion().captures(callee) {
643 if let Some(inner) = caps.get(1) {
644 callee = &callee[inner.range()];
645 }
646 }
647 if callee.is_empty() {
648 return;
649 }
650 let callee = callee.to_string();
651 self.push_ref_at(caller_row, &callee, "calls", node);
652 }
653
654 // --- visitFunctionBody (5129-5286) — the hook-free body walk ----------
655

Callers 2

visitMethod · 0.45
visit_bodyMethod · 0.45

Calls 4

getMethod · 0.65
top_rowMethod · 0.45
textMethod · 0.45
push_ref_atMethod · 0.45

Tested by

no test coverage detected