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

Function sig_token

internal/cbm/callable_sig.c:98–114  ·  view source on GitHub ↗

Append one source token: internal whitespace is dropped except as a single * space between two identifier characters, which is also the rule at the * boundary with what is already in the buffer. */

Source from the content-addressed store, hash-verified

96 * space between two identifier characters, which is also the rule at the
97 * boundary with what is already in the buffer. */
98static void sig_token(sig_ctx_t *c, const char *s, size_t n) {
99 bool pending_space = false;
100 for (size_t i = 0; i < n; i++) {
101 unsigned char ch = (unsigned char)s[i];
102 if (isspace(ch)) {
103 pending_space = true;
104 continue;
105 }
106 bool first = c->len == 0 || c->buf[c->len - 1] == ' ';
107 if (!first && sig_ident_char((unsigned char)c->buf[c->len - 1]) && sig_ident_char(ch) &&
108 (pending_space || i == 0)) {
109 sig_raw(c, " ", 1);
110 }
111 pending_space = false;
112 sig_raw(c, (const char *)&s[i], 1);
113 }
114}
115
116static const char *sig_variadic_marker(CBMLanguage lang) {
117 return lang == CBM_LANG_JAVA ? "[]" : "~";

Callers 1

sig_leafFunction · 0.85

Calls 2

sig_ident_charFunction · 0.85
sig_rawFunction · 0.85

Tested by

no test coverage detected