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

Function cs_header_broken

internal/cbm/doclink_cs.c:2204–2218  ·  view source on GitHub ↗

A member whose header did not parse: an error node among its own parts, or * (for a callable) an error anywhere outside its body. Its name and signature * cannot be trusted then -- `public safe extern int M();` comes back as a * method named `extern`. */

Source from the content-addressed store, hash-verified

2202 * cannot be trusted then -- `public safe extern int M();` comes back as a
2203 * method named `extern`. */
2204static bool cs_header_broken(TSNode decl, bool callable) {
2205 TSNode body = callable ? cs_field(decl, "body") : (TSNode){0};
2206 bool broken = false;
2207 cs_kids_t k = cs_kids(decl);
2208 TSNode ch;
2209 while (!broken && cs_kids_next(&k, &ch)) {
2210 if (!ts_node_is_null(body) && ts_node_eq(ch, body)) {
2211 continue;
2212 }
2213 broken = cs_kind_is(ch, "ERROR") || ts_node_is_missing(ch) ||
2214 (callable && ts_node_has_error(ch));
2215 }
2216 cs_kids_end(&k);
2217 return broken;
2218}
2219
2220static void cs_collect_member(cs_scan_t *s, TSNode c, const char *k, int owner) {
2221 TSNode null_node = {0};

Callers 1

cs_collect_memberFunction · 0.85

Calls 5

cs_fieldFunction · 0.85
cs_kidsFunction · 0.85
cs_kids_nextFunction · 0.85
cs_kind_isFunction · 0.85
cs_kids_endFunction · 0.85

Tested by

no test coverage detected