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

Function implicit_roots

src/pipeline/doc_links_cs.c:5226–5249  ·  view source on GitHub ↗

The implicit roots a type of this kind derives from without naming them, * as far as the repository declares them. */

Source from the content-addressed store, hash-verified

5224/* The implicit roots a type of this kind derives from without naming them,
5225 * as far as the repository declares them. */
5226static int implicit_roots(const cs_ctx_t *c, char kind, int *out) {
5227 static const char *const enum_roots[] = {"Enum", "ValueType", "Object", NULL};
5228 static const char *const value_roots[] = {"ValueType", "Object", NULL};
5229 static const char *const object_root[] = {"Object", NULL};
5230 static const char system_ns[] = "System";
5231 const char *const *roots = object_root;
5232 if (kind == 'e') {
5233 roots = enum_roots;
5234 } else if (kind == 's' || kind == 't') {
5235 roots = value_roots;
5236 } else if (kind == 'i' || kind == 'd') {
5237 return 0;
5238 }
5239 int sys = ns_find(c->ix, 0, system_ns, sizeof(system_ns) - SKIP_ONE);
5240 int n = 0;
5241 for (int i = 0; sys >= 0 && roots[i]; i++) {
5242 cs_found_t fd = {0};
5243 add_types(c, true, sys, roots[i], 0, &fd);
5244 if (fd.n == SKIP_ONE) {
5245 out[n++] = fd.first.id;
5246 }
5247 }
5248 return n;
5249}
5250
5251/* NOT the compiler's rule (see CS_BIND_INHERITED): where the compiler's
5252 * lookup has bound nothing, the member `seg` of the nearest supertype of

Callers 1

inherited_resultFunction · 0.85

Calls 2

ns_findFunction · 0.85
add_typesFunction · 0.85

Tested by

no test coverage detected