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

Function sig_render

internal/cbm/callable_sig.c:937–989  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

935/* ── Builder ───────────────────────────────────────────────────── */
936
937static void sig_render(sig_ctx_t *c, TSNode node) {
938 switch (c->lang) {
939 case CBM_LANG_CPP:
940 case CBM_LANG_CUDA:
941 case CBM_LANG_C: {
942 TSNode fdecl = sig_c_function_declarator(node);
943 if (c->lang != CBM_LANG_C && !sig_cpp_member_of_class_template(fdecl)) {
944 sig_cpp_tparams(c, node);
945 }
946 if (ts_node_is_null(fdecl)) {
947 c->open_off = c->len;
948 sig_raw(c, "()", 2);
949 c->close_off = c->len;
950 return;
951 }
952 sig_c_param_list(c, fdecl);
953 sig_cpp_cvref(c, fdecl);
954 return;
955 }
956 default:
957 break;
958 }
959 if (c->lang == CBM_LANG_CSHARP) {
960 sig_cs_tparams(c, node);
961 }
962 c->open_off = c->len;
963 sig_raw(c, "(", 1);
964 switch (c->lang) {
965 case CBM_LANG_JAVA:
966 sig_java_params(c, node);
967 break;
968 case CBM_LANG_CSHARP:
969 sig_cs_params(c, node);
970 break;
971 case CBM_LANG_KOTLIN:
972 sig_kotlin_params(c, node);
973 break;
974 case CBM_LANG_SWIFT:
975 sig_swift_params(c, node);
976 break;
977 case CBM_LANG_SCALA:
978 sig_scala_params(c, node);
979 break;
980 case CBM_LANG_OBJC:
981 sig_objc_params(c, node);
982 break;
983 default:
984 sig_generic_params(c, node);
985 break;
986 }
987 sig_raw(c, ")", 1);
988 c->close_off = c->len;
989}
990
991static bool sig_roundtrips(const char *suffix, size_t n) {
992 /* "f" + suffix must invert to the base "f". */

Callers 1

cbm_callable_sig_modeFunction · 0.85

Calls 14

sig_cpp_tparamsFunction · 0.85
sig_rawFunction · 0.85
sig_c_param_listFunction · 0.85
sig_cpp_cvrefFunction · 0.85
sig_cs_tparamsFunction · 0.85
sig_java_paramsFunction · 0.85
sig_cs_paramsFunction · 0.85
sig_kotlin_paramsFunction · 0.85
sig_swift_paramsFunction · 0.85
sig_scala_paramsFunction · 0.85

Tested by

no test coverage detected