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

Function reference_name

internal/cbm/extract_usages.c:1572–1585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1570}
1571
1572static char *reference_name(CBMExtractCtx *ctx, TSNode node) {
1573 char *name = cbm_node_text(ctx->arena, node, ctx->source);
1574 if (!name || ctx->language != CBM_LANG_MAKEFILE ||
1575 strcmp(ts_node_type(node), "variable_reference") != 0) {
1576 return name;
1577 }
1578
1579 /* Make exposes `$(watched)` as one named reference node.
1580 * Normalize only that grammar wrapper; the recorded site still spans the
1581 * exact source occurrence for occurrence-sensitive resolution. */
1582 size_t length = strlen(name);
1583 bool parenthesized = length > 3 && name[0] == '$' && name[1] == '(' && name[length - 1] == ')';
1584 return parenthesized ? cbm_arena_strndup(ctx->arena, name + 2, length - 3) : name;
1585}
1586
1587static bool lexical_identifier_case_insensitive(CBMLanguage language) {
1588 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