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

Function pair_key

internal/cbm/extract_url_fold.c:326–339  ·  view source on GitHub ↗

The key of an object-literal pair as a plain name, or NULL. */

Source from the content-addressed store, hash-verified

324
325/* The key of an object-literal pair as a plain name, or NULL. */
326static const char *pair_key(CBMExtractCtx *ctx, TSNode pair) {
327 TSNode key = ts_node_child_by_field_name(pair, TS_FIELD("key"));
328 if (ts_node_is_null(key)) {
329 return NULL;
330 }
331 const char *k = ts_node_type(key);
332 if (strcmp(k, "property_identifier") == 0) {
333 return cbm_node_text(ctx->arena, key, ctx->source);
334 }
335 if (strcmp(k, "string") == 0) {
336 return fold_string_like(ctx, key, 0, false);
337 }
338 return NULL;
339}
340
341static void record_object(CBMExtractCtx *ctx, const char *prefix, TSNode obj, int depth) {
342 uint32_t nc = ts_node_named_child_count(obj);

Callers 1

record_objectFunction · 0.85

Calls 2

cbm_node_textFunction · 0.85
fold_string_likeFunction · 0.85

Tested by

no test coverage detected