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

Function cs_group_end

internal/cbm/doclink_cs.c:467–481  ·  view source on GitHub ↗

Index just past the bracket group opened at s[i] (one of < { [ ( ), * matching nested groups of any of those kinds; t->len when unbalanced. */

Source from the content-addressed store, hash-verified

465/* Index just past the bracket group opened at s[i] (one of < { [ ( ),
466 * matching nested groups of any of those kinds; t->len when unbalanced. */
467static size_t cs_group_end(const cs_str_t *t, size_t i) {
468 int depth = 0;
469 for (size_t k = i; k < t->len; k++) {
470 char c = t->s[k];
471 if (c == '<' || c == '{' || c == '[' || c == '(') {
472 depth++;
473 } else if (c == '>' || c == '}' || c == ']' || c == ')') {
474 depth--;
475 if (depth == 0) {
476 return k + SKIP_ONE;
477 }
478 }
479 }
480 return t->len;
481}
482
483/* Leading parameter attribute lists: [NotNull] [In] T x. */
484static void cs_drop_attributes(cs_str_t *t) {

Callers 2

cs_drop_attributesFunction · 0.85
cs_unwrap_nullableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected