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

Function find_nth

tests/test_callable_sig.c:23–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21} sig_case_t;
22
23static bool find_nth(TSNode n, const char *kind, int *left, TSNode *out) {
24 if (strcmp(ts_node_type(n), kind) == 0) {
25 if (*left == 0) {
26 *out = n;
27 return true;
28 }
29 (*left)--;
30 }
31 uint32_t count = ts_node_child_count(n);
32 for (uint32_t i = 0; i < count; i++) {
33 if (find_nth(ts_node_child(n, i), kind, left, out)) {
34 return true;
35 }
36 }
37 return false;
38}
39
40/* Parse `source`, build the nth `kind` node's suffix in `mode`; the returned
41 * string is arena-owned (NULL when absent). */

Callers 2

sig_ofFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected