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

Function sh_clause_end

src/pipeline/pass_shell.c:505–513  ·  view source on GitHub ↗

End one alternative of a conditional: what it set is noted, then undone. */

Source from the content-addressed store, hash-verified

503
504/* End one alternative of a conditional: what it set is noted, then undone. */
505static void sh_clause_end(sh_t *s, sh_mark_t m, sh_touch_t *t) {
506 for (int i = m.undo; i < s->nundo; i++) {
507 sh_touch_add(t, s->undo[i].name);
508 }
509 if (!sh_cwd_same(s->cwd, m.cwd) || s->ndirs != m.ndirs) {
510 t->cwd = true;
511 }
512 sh_rewind(s, m);
513}
514
515/* After the conditional: whatever any alternative set is unknown. */
516static void sh_group_end(sh_t *s, sh_touch_t *t) {

Callers 4

sh_listFunction · 0.85
sh_ifFunction · 0.85
sh_caseFunction · 0.85
sh_loopFunction · 0.85

Calls 3

sh_touch_addFunction · 0.85
sh_cwd_sameFunction · 0.85
sh_rewindFunction · 0.85

Tested by

no test coverage detected