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

Function process_keyword_arg

internal/cbm/extract_calls.c:1317–1334  ·  view source on GitHub ↗

Process a keyword argument (keyword_argument or pair node).

Source from the content-addressed store, hash-verified

1315
1316// Process a keyword argument (keyword_argument or pair node).
1317static void process_keyword_arg(CBMExtractCtx *ctx, TSNode arg_node, CBMCallArg *ca) {
1318 TSNode key_n = ts_node_child_by_field_name(arg_node, TS_FIELD("name"));
1319 TSNode val_n = ts_node_child_by_field_name(arg_node, TS_FIELD("value"));
1320 if (ts_node_is_null(key_n)) {
1321 key_n = ts_node_child_by_field_name(arg_node, TS_FIELD("key"));
1322 }
1323 if (!ts_node_is_null(key_n)) {
1324 ca->keyword = cbm_node_text(ctx->arena, key_n, ctx->source);
1325 }
1326 if (!ts_node_is_null(val_n)) {
1327 ca->expr = cbm_node_text(ctx->arena, val_n, ctx->source);
1328 if (strcmp(ts_node_type(val_n), "identifier") == 0 && ca->expr) {
1329 ca->value = lookup_string_constant(ctx, ca->expr);
1330 } else if (is_string_like(ts_node_type(val_n)) && ca->expr) {
1331 ca->value = strip_quotes(ctx->arena, ca->expr);
1332 }
1333 }
1334}
1335
1336/* Extract all arguments from a call expression into call->args[]. */
1337static void extract_call_args(CBMExtractCtx *ctx, TSNode args, CBMCall *call) {

Callers 1

extract_call_argsFunction · 0.85

Calls 4

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

Tested by

no test coverage detected