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

Function process_keyword_arg

internal/cbm/extract_calls.c:2465–2487  ·  view source on GitHub ↗

Process a keyword argument (keyword_argument or pair node).

Source from the content-addressed store, hash-verified

2463
2464// Process a keyword argument (keyword_argument or pair node).
2465static void process_keyword_arg(CBMExtractCtx *ctx, TSNode arg_node, CBMCallArg *ca) {
2466 TSNode key_n = ts_node_child_by_field_name(arg_node, TS_FIELD("name"));
2467 TSNode val_n = ts_node_child_by_field_name(arg_node, TS_FIELD("value"));
2468 if (ts_node_is_null(key_n)) {
2469 key_n = ts_node_child_by_field_name(arg_node, TS_FIELD("key"));
2470 }
2471 if (!ts_node_is_null(key_n)) {
2472 ca->keyword = cbm_node_text(ctx->arena, key_n, ctx->source);
2473 }
2474 if (!ts_node_is_null(val_n)) {
2475 ca->expr = cbm_node_text(ctx->arena, val_n, ctx->source);
2476 /* Only a fully resolved fold is an exact value (#706, #1147). */
2477 fold_call_arg(ctx, val_n, ca);
2478 if (ca->value || is_folded_reference(ctx, ts_node_type(val_n))) {
2479 return;
2480 }
2481 if (strcmp(ts_node_type(val_n), "identifier") == 0 && ca->expr) {
2482 ca->value = lookup_string_constant(ctx, ca->expr);
2483 } else if (is_string_like(ts_node_type(val_n)) && ca->expr) {
2484 ca->value = strip_quotes(ctx->arena, ca->expr);
2485 }
2486 }
2487}
2488
2489static const char *extract_string_value(CBMExtractCtx *ctx, TSNode val_node, bool url_context);
2490

Callers 1

extract_call_argsFunction · 0.85

Calls 6

cbm_node_textFunction · 0.85
fold_call_argFunction · 0.85
is_folded_referenceFunction · 0.85
lookup_string_constantFunction · 0.85
is_string_likeFunction · 0.85
strip_quotesFunction · 0.70

Tested by

no test coverage detected