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

Function sig_c_function_declarator

internal/cbm/callable_sig.c:376–398  ·  view source on GitHub ↗

The function_declarator of a C-family definition/declaration, looking * through (nested) template_declarations and pointer/reference return * declarators. */

Source from the content-addressed store, hash-verified

374 * through (nested) template_declarations and pointer/reference return
375 * declarators. */
376static TSNode sig_c_function_declarator(TSNode node) {
377 TSNode cur = node;
378 for (int depth = 0; depth < SIG_DECL_DEPTH && !ts_node_is_null(cur) &&
379 strcmp(ts_node_type(cur), "template_declaration") == 0;
380 depth++) {
381 TSNode inner = {0};
382 uint32_t count = ts_node_named_child_count(cur);
383 for (uint32_t i = 0; i < count && ts_node_is_null(inner); i++) {
384 TSNode ch = ts_node_named_child(cur, i);
385 if (sig_is_c_decl_kind(ts_node_type(ch))) {
386 inner = ch;
387 }
388 }
389 cur = inner;
390 }
391 for (int depth = 0; depth < SIG_DECL_DEPTH && !ts_node_is_null(cur); depth++) {
392 if (strcmp(ts_node_type(cur), "function_declarator") == 0) {
393 return cur;
394 }
395 cur = sig_c_inner_declarator(cur);
396 }
397 return (TSNode){0};
398}
399
400static void sig_c_qualifiers(sig_ctx_t *c, TSNode n) {
401 uint32_t count = ts_node_named_child_count(n);

Callers 1

sig_renderFunction · 0.85

Calls 2

sig_is_c_decl_kindFunction · 0.85
sig_c_inner_declaratorFunction · 0.85

Tested by

no test coverage detected