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

Function ts_line_inline

internal/cbm/doclink_ts.c:283–306  ·  view source on GitHub ↗

... and code ... of one line; true when the line holds one. */

Source from the content-addressed store, hash-verified

281
282/* {@link ...} and {@linkcode ...} of one line; true when the line holds one. */
283static bool ts_line_inline(const ts_emit_t *em, const ts_line_t *ln, const bool *mask) {
284 bool any = false;
285 static const char open[] = "{@link";
286 size_t ol = sizeof(open) - SKIP_ONE;
287 for (size_t i = 0; i + ol <= ln->n; i++) {
288 if (mask[i] || memcmp(ln->p + i, open, ol) != 0) {
289 continue;
290 }
291 size_t j = i + ol;
292 int syntax = CBM_DOCLINK_TS_LINK;
293 if (j + CBM_SZ_4 <= ln->n && memcmp(ln->p + j, "code", CBM_SZ_4) == 0) {
294 syntax = CBM_DOCLINK_TS_LINKCODE;
295 j += CBM_SZ_4;
296 }
297 if (j < ln->n && ln->p[j] != '}' && !isspace((unsigned char)ln->p[j])) {
298 continue; /* {@linkplain} or another word */
299 }
300 any = true;
301 j = ts_skip_space(ln->p, j, ln->n);
302 ts_push(em, ln->p + j, ts_ref_len(ln->p + j, ln->n - j), syntax, ln->line);
303 i = j;
304 }
305 return any;
306}
307
308/* `@see Ref` at the start of a tag line. */
309static void ts_line_see(const ts_emit_t *em, const ts_line_t *ln) {

Callers 1

cbm_doclink_ts_parse_docFunction · 0.85

Calls 3

ts_skip_spaceFunction · 0.85
ts_pushFunction · 0.85
ts_ref_lenFunction · 0.85

Tested by

no test coverage detected