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

Function rs_scan_tuple_fields

internal/cbm/doclink_rs.c:2859–2873  ·  view source on GitHub ↗

The positional fields of a tuple struct: members `0`, `1` ... without a * node. */

Source from the content-addressed store, hash-verified

2857/* The positional fields of a tuple struct: members `0`, `1` ... without a
2858 * node. */
2859static void rs_scan_tuple_fields(rs_scan_t *s, TSNode body) {
2860 TSTreeCursor cur = ts_tree_cursor_new(body);
2861 uint32_t index = 0;
2862 bool more = ts_tree_cursor_goto_first_child(&cur);
2863 for (; more && !s->failed; more = ts_tree_cursor_goto_next_sibling(&cur)) {
2864 const char *field = ts_tree_cursor_current_field_name(&cur);
2865 if (!field || strcmp(field, "type") != 0) {
2866 continue;
2867 }
2868 char name[RS_UINT_DIGITS];
2869 snprintf(name, sizeof(name), "%u", index++);
2870 rs_rec_member(s, 0, 'd', name, CBM_NOT_FOUND);
2871 }
2872 ts_tree_cursor_delete(&cur);
2873}
2874
2875/* ── Scope scan: `use` ───────────────────────────────────────────── */
2876

Callers 1

rs_item_membersFunction · 0.85

Calls 1

rs_rec_memberFunction · 0.85

Tested by

no test coverage detected