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

Function extract_string_value

internal/cbm/extract_calls.c:1405–1419  ·  view source on GitHub ↗

Extract string value from a node (literal or constant reference).

Source from the content-addressed store, hash-verified

1403
1404// Extract string value from a node (literal or constant reference).
1405static const char *extract_string_value(CBMExtractCtx *ctx, TSNode val_node) {
1406 const char *vk = ts_node_type(val_node);
1407 if (is_string_like(vk)) {
1408 char *text = cbm_node_text(ctx->arena, val_node, ctx->source);
1409 if (text && text[0]) {
1410 return strip_quotes(ctx->arena, text);
1411 }
1412 } else if (strcmp(vk, "identifier") == 0) {
1413 char *const_name = cbm_node_text(ctx->arena, val_node, ctx->source);
1414 if (const_name) {
1415 return lookup_string_constant(ctx, const_name);
1416 }
1417 }
1418 return NULL;
1419}
1420
1421// Recover a queue/topic identity from a Go composite-literal input struct, e.g.
1422// &sqs.SendMessageInput{QueueUrl: queueUrl, MessageBody: body}

Callers 2

extract_keyword_urlFunction · 0.85

Calls 4

is_string_likeFunction · 0.85
cbm_node_textFunction · 0.85
lookup_string_constantFunction · 0.85
strip_quotesFunction · 0.70

Tested by

no test coverage detected