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

Function rs_inline_scan

internal/cbm/doclink_rs.c:2000–2021  ·  view source on GitHub ↗

Find the links of one paragraph. */

Source from the content-addressed store, hash-verified

1998
1999/* Find the links of one paragraph. */
2000static void rs_inline_scan(rs_inline_t *in) {
2001 uint32_t i = 0;
2002 while (i < in->n) {
2003 char c = in->s[i];
2004 if (c == '\\' && i + SKIP_ONE < in->n && ispunct((unsigned char)in->s[i + SKIP_ONE])) {
2005 i += PAIR_LEN;
2006 } else if (c == '`') {
2007 i = rs_inline_backticks(in, i);
2008 } else if (c == '<') {
2009 i = rs_inline_angle(in, i);
2010 } else if (c == '[') {
2011 bool image = i > 0 && in->s[i - SKIP_ONE] == '!' &&
2012 !(i > SKIP_ONE && in->s[i - PAIR_LEN] == '\\');
2013 in->open[in->nopen++] = (rs_opener_t){.pos = i, .image = image};
2014 i++;
2015 } else if (c == ']') {
2016 i = rs_inline_close(in, i);
2017 } else {
2018 i++;
2019 }
2020 }
2021}
2022
2023/* ── Tokens of one doc text ──────────────────────────────────────── */
2024

Callers 1

rs_scan_paragraphFunction · 0.85

Calls 3

rs_inline_backticksFunction · 0.85
rs_inline_angleFunction · 0.85
rs_inline_closeFunction · 0.85

Tested by

no test coverage detected