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

Function c_mask

internal/cbm/doclink_c.c:195–215  ·  view source on GitHub ↗

Mark the bytes of a line that sit in a code span or a quoted label. */

Source from the content-addressed store, hash-verified

193
194/* Mark the bytes of a line that sit in a code span or a quoted label. */
195static void c_mask(const c_line_t *ln, bool *mask) {
196 for (size_t i = 0; i < ln->n;) {
197 char q = ln->p[i];
198 if (q != '`' && q != '"') {
199 i++;
200 continue;
201 }
202 size_t j = i + SKIP_ONE;
203 while (j < ln->n && ln->p[j] != q) {
204 j++;
205 }
206 if (j >= ln->n) {
207 i++; /* unpaired */
208 continue;
209 }
210 for (size_t k = i; k <= j; k++) {
211 mask[k] = true;
212 }
213 i = j + SKIP_ONE;
214 }
215}
216
217/* A command at p[i] (`\word` or `@word`, not inside a word or an address):
218 * the word's length, else 0. */

Callers 1

c_harvestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected