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

Function c_ref

internal/cbm/doclink_c.c:264–279  ·  view source on GitHub ↗

`@ref name`: the name after the command (sentence punctuation dropped, * `()` kept); returns the position after it. */

Source from the content-addressed store, hash-verified

262/* `@ref name`: the name after the command (sentence punctuation dropped,
263 * `()` kept); returns the position after it. */
264static size_t c_ref(const c_emit_t *em, const c_line_t *ln, size_t j, const bool *mask) {
265 j = c_skip_space(ln->p, j, ln->n);
266 size_t k = j;
267 while (k < ln->n && !isspace((unsigned char)ln->p[k]) && ln->p[k] != '"' && !mask[k]) {
268 k++;
269 }
270 size_t e = k;
271 while (e > j && strchr(".,;:", ln->p[e - SKIP_ONE])) {
272 e--;
273 }
274 if (e > j && ln->p[e - SKIP_ONE] == ')' && !(e - j >= PAIR_LEN && ln->p[e - PAIR_LEN] == '(')) {
275 e--; /* a closing parenthesis of the prose around it */
276 }
277 c_push(em, ln->p + j, e - j, CBM_DOCLINK_C_REF, ln->line);
278 return k;
279}
280
281/* A word of an @see paragraph: a token when it has the shape of a symbol. */
282static void c_see_word(const c_emit_t *em, const char *w, size_t n, uint32_t line) {

Callers 1

c_lineFunction · 0.85

Calls 2

c_skip_spaceFunction · 0.85
c_pushFunction · 0.85

Tested by

no test coverage detected