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

Function cbm_source_nesting_exceeds

internal/cbm/cbm.c:1415–1428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1413#define CBM_PERL_MAX_PARSE_NESTING 128
1414
1415static bool cbm_source_nesting_exceeds(const char *source, int source_len, int cap) {
1416 int depth = 0;
1417 for (int i = 0; i < source_len; i++) {
1418 char c = source[i];
1419 if (c == '(' || c == '[' || c == '{') {
1420 if (++depth > cap) {
1421 return true;
1422 }
1423 } else if ((c == ')' || c == ']' || c == '}') && depth > 0) {
1424 depth--;
1425 }
1426 }
1427 return false;
1428}
1429
1430/* Best-effort parse-coverage collection (#963). Walks only the has_error paths
1431 * of the tree and records the 1-based line ranges of the TOP-MOST ERROR/MISSING

Callers 1

extract_file_ex_bodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected