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

Function gc_block_end

src/pipeline/pass_operator.c:1081–1097  ·  view source on GitHub ↗

The '}' closing the block opened at `open`. */

Source from the content-addressed store, hash-verified

1079
1080/* The '}' closing the block opened at `open`. */
1081static const char *gc_block_end(const char *open) {
1082 int depth = 0;
1083 for (const char *p = open; *p;) {
1084 const char *q = gc_skip(p);
1085 if (q != p) {
1086 p = q;
1087 continue;
1088 }
1089 depth += *p == '{';
1090 depth -= *p == '}';
1091 if (depth == 0) {
1092 return p;
1093 }
1094 p++;
1095 }
1096 return open + strlen(open);
1097}
1098
1099/* The top-level comma-separated parts of the list opened at `open` ('(').
1100 * Returns their count (at most `max`); *end: the closing ')'. */

Callers 2

gc_summarizeFunction · 0.85
gc_body_ofFunction · 0.85

Calls 1

gc_skipFunction · 0.85

Tested by

no test coverage detected