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

Function cs_open_push

internal/cbm/doclink_cs.c:1269–1286  ·  view source on GitHub ↗

Brace `b` is open now: it goes on top of the open braces. */

Source from the content-addressed store, hash-verified

1267
1268/* Brace `b` is open now: it goes on top of the open braces. */
1269static bool cs_open_push(cs_scan_t *s, int b) {
1270 if (s->nopen >= s->cap_open) {
1271 int ncap = s->cap_open ? s->cap_open * PAIR_LEN : CS_HEADS_INIT;
1272 cs_open_t *grown = (cs_open_t *)cs_tmp_alloc(s, (size_t)ncap * sizeof(*grown));
1273 if (!grown) {
1274 return false;
1275 }
1276 if (s->nopen > 0) {
1277 memcpy(grown, s->open, (size_t)s->nopen * sizeof(*grown));
1278 }
1279 s->open = grown;
1280 s->cap_open = ncap;
1281 }
1282 s->open[s->nopen] = (cs_open_t){.brace = b, .below = s->top};
1283 s->top = s->nopen++;
1284 s->sp++;
1285 return true;
1286}
1287
1288static void cs_mark_untrusted_at(cs_scan_t *s, uint32_t pos, uint32_t row) {
1289 if (pos < s->untrusted) {

Callers 1

cs_lex_braceFunction · 0.85

Calls 1

cs_tmp_allocFunction · 0.85

Tested by

no test coverage detected