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

Function jv_java_container

internal/cbm/doclink_jvm.c:2338–2373  ·  view source on GitHub ↗

The declarations of a class body (or of the file): types, members, * imports. `depth` is the nesting of the types declared here; jv_java_type * bounds it, and so the recursion. */

Source from the content-addressed store, hash-verified

2336 * imports. `depth` is the nesting of the types declared here; jv_java_type
2337 * bounds it, and so the recursion. */
2338static void jv_java_container(jv_scan_t *s, TSNode body, const jv_frame_t *fr, int depth) {
2339 bool enum_members = jv_kind(body, "enum_body_declarations");
2340 TSTreeCursor cur = ts_tree_cursor_new(body);
2341 if (ts_tree_cursor_goto_first_child(&cur)) {
2342 do {
2343 TSNode c = ts_tree_cursor_current_node(&cur);
2344 const char *k = ts_node_type(c);
2345 char tk = jv_java_type_kind(k);
2346 if (ts_node_is_error(c)) {
2347 jv_unplaced(s, c, true);
2348 } else if (ts_node_is_missing(c)) {
2349 continue;
2350 } else if (tk) {
2351 jv_java_type(s, c, tk, fr, depth);
2352 } else if (strcmp(k, "import_declaration") == 0) {
2353 jv_java_import(s, c);
2354 } else if (strcmp(k, "enum_body_declarations") == 0) {
2355 if (!enum_members) {
2356 jv_java_container(s, c, fr, depth); /* the same type's members */
2357 }
2358 } else if (fr->owner == JV_NO_OWNER) {
2359 continue; /* the file itself has no members */
2360 } else if (jv_java_is_callable(k)) {
2361 jv_java_callable(s, c, k, fr);
2362 } else if (strcmp(k, "enum_constant") == 0) {
2363 if (jv_member_ok(s, c, (TSNode){0}, false, fr->inner_depth)) {
2364 jv_member_seen(s, c, (TSNode){0}, false);
2365 jv_emit_value(s, jv_line(c), jv_field(c, "name"), "n", "-", fr);
2366 }
2367 } else if (jv_java_is_value(k)) {
2368 jv_java_fields(s, c, fr);
2369 }
2370 } while (!s->failed && ts_tree_cursor_goto_next_sibling(&cur));
2371 }
2372 ts_tree_cursor_delete(&cur);
2373}
2374
2375/* ── Kotlin ──────────────────────────────────────────────────────── */
2376

Callers 2

jv_java_typeFunction · 0.85
jv_scan_scopeFunction · 0.85

Calls 14

jv_kindFunction · 0.85
jv_java_type_kindFunction · 0.85
jv_unplacedFunction · 0.85
jv_java_typeFunction · 0.85
jv_java_importFunction · 0.85
jv_java_is_callableFunction · 0.85
jv_java_callableFunction · 0.85
jv_member_okFunction · 0.85
jv_member_seenFunction · 0.85
jv_emit_valueFunction · 0.85
jv_lineFunction · 0.85
jv_fieldFunction · 0.85

Tested by

no test coverage detected