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

Function sig_c_nested_params

internal/cbm/callable_sig.c:447–474  ·  view source on GitHub ↗

The parameter list of a function-typed parameter (`int (*cb)(int x)`), * spelled from its tokens without parameter names or default values. */

Source from the content-addressed store, hash-verified

445/* The parameter list of a function-typed parameter (`int (*cb)(int x)`),
446 * spelled from its tokens without parameter names or default values. */
447static void sig_c_nested_params(sig_ctx_t *c, TSNode fdecl) {
448 TSNode params = sig_field(fdecl, "parameters");
449 sig_raw(c, "(", 1);
450 uint32_t count = ts_node_is_null(params) ? 0 : ts_node_child_count(params);
451 bool void_list = !ts_node_is_null(params) && sig_c_is_void_list(c, params);
452 int written = 0;
453 bool saved = c->skip_names;
454 c->skip_names = true;
455 for (uint32_t i = 0; i < count && !void_list; i++) {
456 TSNode p = ts_node_child(params, i);
457 bool is_ellipsis = !ts_node_is_named(p) && sig_node_text_is(c, p, "...");
458 if (!is_ellipsis && !sig_c_is_param_kind(ts_node_type(p))) {
459 continue;
460 }
461 if (written++) {
462 sig_raw(c, ",", 1);
463 }
464 if (is_ellipsis) {
465 sig_raw_str(c, sig_variadic_marker(c->lang));
466 continue;
467 }
468 sig_c_qualifiers(c, p);
469 sig_type_tokens(c, sig_field(p, "type"));
470 sig_type_tokens(c, sig_field(p, "declarator"));
471 }
472 c->skip_names = saved;
473 sig_raw(c, ")", 1);
474}
475
476/* Declarator markers, outermost first: `*` (with its qualifiers unless it is
477 * the top-level one, which the language drops), `&`/`&&`, an array that

Callers 1

sig_c_markersFunction · 0.85

Calls 9

sig_fieldFunction · 0.85
sig_rawFunction · 0.85
sig_c_is_void_listFunction · 0.85
sig_node_text_isFunction · 0.85
sig_c_is_param_kindFunction · 0.85
sig_raw_strFunction · 0.85
sig_variadic_markerFunction · 0.85
sig_c_qualifiersFunction · 0.85
sig_type_tokensFunction · 0.85

Tested by

no test coverage detected