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

Function reference_name

internal/cbm/extract_usages.c:1602–1615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1600}
1601
1602static char *reference_name(CBMExtractCtx *ctx, TSNode node) {
1603 char *name = cbm_node_text(ctx->arena, node, ctx->source);
1604 if (!name || ctx->language != CBM_LANG_MAKEFILE ||
1605 strcmp(ts_node_type(node), "variable_reference") != 0) {
1606 return name;
1607 }
1608
1609 /* Make exposes `$(watched)` as one named reference node.
1610 * Normalize only that grammar wrapper; the recorded site still spans the
1611 * exact source occurrence for occurrence-sensitive resolution. */
1612 size_t length = strlen(name);
1613 bool parenthesized = length > 3 && name[0] == '$' && name[1] == '(' && name[length - 1] == ')';
1614 return parenthesized ? cbm_arena_strndup(ctx->arena, name + 2, length - 3) : name;
1615}
1616
1617static bool lexical_identifier_case_insensitive(CBMLanguage language) {
1618 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