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

Function extract_positional_url

internal/cbm/extract_calls.c:1506–1521  ·  view source on GitHub ↗

Try to extract URL/topic from a positional argument (string or constant).

Source from the content-addressed store, hash-verified

1504
1505// Try to extract URL/topic from a positional argument (string or constant).
1506static const char *extract_positional_url(CBMExtractCtx *ctx, TSNode arg, const char *ak) {
1507 if (is_string_like(ak)) {
1508 char *text = cbm_node_text(ctx->arena, arg, ctx->source);
1509 const char *validated = strip_and_validate_string_arg(ctx->arena, text);
1510 if (validated) {
1511 return validated;
1512 }
1513 }
1514 if (strcmp(ak, "identifier") == 0) {
1515 char *const_name = cbm_node_text(ctx->arena, arg, ctx->source);
1516 if (const_name) {
1517 return lookup_string_constant(ctx, const_name);
1518 }
1519 }
1520 return NULL;
1521}
1522
1523// Extract URL/topic from keyword or positional args.
1524static const char *extract_url_or_topic_arg(CBMExtractCtx *ctx, TSNode args) {

Callers 1

extract_url_or_topic_argFunction · 0.85

Calls 4

is_string_likeFunction · 0.85
cbm_node_textFunction · 0.85
lookup_string_constantFunction · 0.85

Tested by

no test coverage detected