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

Function cbm_source_nesting_exceeds

internal/cbm/cbm.c:753–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

751#define CBM_PERL_MAX_PARSE_NESTING 128
752
753static bool cbm_source_nesting_exceeds(const char *source, int source_len, int cap) {
754 int depth = 0;
755 for (int i = 0; i < source_len; i++) {
756 char c = source[i];
757 if (c == '(' || c == '[' || c == '{') {
758 if (++depth > cap) {
759 return true;
760 }
761 } else if ((c == ')' || c == ']' || c == '}') && depth > 0) {
762 depth--;
763 }
764 }
765 return false;
766}
767
768/* Best-effort parse-coverage collection (#963). Walks only the has_error paths
769 * of the tree and records the 1-based line ranges of the TOP-MOST ERROR/MISSING

Callers 1

cbm_extract_file_exFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected