call helpers
_call_helpers
Internal-API helpers for tree-sitter call-site analysis.
This module's name has a leading underscore (_call_helpers) to mark it as
package-internal-but-importable across axm_ast.core — distinct from the
symbol-level _prefix convention which is module-local. Symbols defined
here are public (no underscore prefix) so other axm_ast.core modules can
import them without violating the no-private-cross-module-import rule.
Internal API: importable across axm_ast.core only. Not exported from the
package root.
extract_call_site(node, module, source_bytes, context)
Build a :class:CallSite from a tree-sitter call node.
Returns None when the called symbol cannot be resolved (e.g. dynamic
constructions like getattr(obj, name)()).
Source code in packages/axm-ast/src/axm_ast/core/_call_helpers.py
is_call_node(node)
node_text_safe(node, source_bytes=b'')
Return the text covered by node, or "" when node is None.
The source_bytes argument is reserved for callers that wish to slice
the source explicitly; the default reads node.text (populated by
tree-sitter).
Source code in packages/axm-ast/src/axm_ast/core/_call_helpers.py
update_context(node, source_bytes=b'', *, current=None)
Return the enclosing function/class name when node is a definition.
Otherwise return current unchanged. Used by call-site walkers to track the surrounding scope when recording each call.