MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / reference_name

Function reference_name

internal/cbm/extract_usages.c:1630–1643  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1628}
1629
1630static char *reference_name(CBMExtractCtx *ctx, TSNode node) {
1631 char *name = cbm_node_text(ctx->arena, node, ctx->source);
1632 if (!name || ctx->language != CBM_LANG_MAKEFILE ||
1633 strcmp(ts_node_type(node), "variable_reference") != 0) {
1634 return name;
1635 }
1636
1637 /* Make exposes `$(watched)` as one named reference node.
1638 * Normalize only that grammar wrapper; the recorded site still spans the
1639 * exact source occurrence for occurrence-sensitive resolution. */
1640 size_t length = strlen(name);
1641 bool parenthesized = length > 3 && name[0] == '$' && name[1] == '(' && name[length - 1] == ')';
1642 return parenthesized ? cbm_arena_strndup(ctx->arena, name + 2, length - 3) : name;
1643}
1644
1645static bool lexical_identifier_case_insensitive(CBMLanguage language) {
1646 switch (language) {

Callers 2

try_emit_usageFunction · 0.85
handle_usagesFunction · 0.85

Calls 2

cbm_node_textFunction · 0.85
cbm_arena_strndupFunction · 0.70

Tested by

no test coverage detected