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

Function rs_put_params

internal/cbm/doclink_rs.c:2740–2764  ·  view source on GitHub ↗

Every name the patterns of a `parameters` list bind. The walk is a cursor * walk of the list's subtree: no recursion. */

Source from the content-addressed store, hash-verified

2738/* Every name the patterns of a `parameters` list bind. The walk is a cursor
2739 * walk of the list's subtree: no recursion. */
2740static void rs_put_params(rs_scan_t *s, TSNode params, bool *first) {
2741 if (ts_node_is_null(params)) {
2742 return;
2743 }
2744 TSTreeCursor cur = ts_tree_cursor_new(params);
2745 for (;;) {
2746 TSNode n = ts_tree_cursor_current_node(&cur);
2747 const char *field = ts_tree_cursor_current_field_name(&cur);
2748 bool in_type = field && strcmp(field, "type") == 0;
2749 if (rs_kind(n, "identifier") || rs_kind(n, "shorthand_field_identifier")) {
2750 rs_put_local(s, n, first);
2751 }
2752 if (!in_type && ts_tree_cursor_goto_first_child(&cur)) {
2753 continue;
2754 }
2755 bool moved = ts_tree_cursor_goto_next_sibling(&cur);
2756 while (!moved && ts_tree_cursor_goto_parent(&cur)) {
2757 moved = ts_tree_cursor_goto_next_sibling(&cur);
2758 }
2759 if (!moved) {
2760 break;
2761 }
2762 }
2763 ts_tree_cursor_delete(&cur);
2764}
2765
2766/* The P record of the definition at `line`: the type parameters of its owner
2767 * (`outer`, may be null) and, for `item`, its own type parameters and

Callers 1

rs_rec_localsFunction · 0.85

Calls 2

rs_kindFunction · 0.85
rs_put_localFunction · 0.85

Tested by

no test coverage detected