Commit Graph
1 Commits
Author SHA1 Message Date
rajatnagda45 912637d314 fix(rust): extract macro_rules! definitions and resolve their invocations
A `macro_rules! name { ... }` is a named, invocable item, but its node
type (macro_definition) had no branch, so the macro was dropped entirely:
it never became a node, and a `name!(...)` invocation of it (a
macro_invocation, never a call_expression) had nothing to resolve to.

Emit a node per macro_definition and resolve a bare `name!` invocation to
it with a calls edge. Macros are tracked in their own name registry, not
the function/type label map, because a macro and a function can share a
name (`vec!` vs `vec`); the node id is macro-qualified for the same
reason and the label carries a `!`. A scoped invocation (`log::info!`)
is cross-module/crate and stays unresolved (fail-closed).

Adds regression tests for the dropped definition, the resolved local
invocation, name coexistence with a same-named function, and the
unresolved scoped case.

(cherry picked from commit 7010322250)
2026-10-04 01:43:04 +01:00