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

Function jv_java_body_broken

internal/cbm/doclink_jvm.c:2086–2110  ·  view source on GitHub ↗

True when the scan does not show every member of the type whose body this * is: an error node among its members, a member or nested type that could * not be placed, an error inside a member that has no block of its own to * hold it, or (`leaf`: the type is as deep as the scan goes) a nested type. */

Source from the content-addressed store, hash-verified

2084 * not be placed, an error inside a member that has no block of its own to
2085 * hold it, or (`leaf`: the type is as deep as the scan goes) a nested type. */
2086static bool jv_java_body_broken(const jv_scan_t *s, TSNode body, int inner, bool leaf) {
2087 bool broken = false;
2088 bool nested = jv_kind(body, "enum_body_declarations");
2089 TSTreeCursor cur = ts_tree_cursor_new(body);
2090 if (ts_tree_cursor_goto_first_child(&cur)) {
2091 do {
2092 TSNode c = ts_tree_cursor_current_node(&cur);
2093 const char *k = ts_node_type(c);
2094 if (ts_node_is_error(c) || ts_node_is_missing(c)) {
2095 broken = true;
2096 } else if (strcmp(k, "enum_body_declarations") == 0) {
2097 /* the members of an enum, one level below its constants */
2098 broken = nested || jv_java_body_broken(s, c, inner, leaf);
2099 } else if (jv_java_type_kind(k)) {
2100 broken = leaf || !jv_type_placed(s, c, jv_field(c, "body"), inner);
2101 } else if (jv_java_is_callable(k)) {
2102 broken = !jv_member_ok(s, c, jv_field(c, "body"), true, inner);
2103 } else if (jv_java_is_value(k)) {
2104 broken = jv_errors_leak(s, c) || !jv_member_ok(s, c, (TSNode){0}, false, inner);
2105 }
2106 } while (!broken && ts_tree_cursor_goto_next_sibling(&cur));
2107 }
2108 ts_tree_cursor_delete(&cur);
2109 return broken;
2110}
2111
2112static void jv_java_put_supers(jv_scan_t *s, TSNode decl) {
2113 bool first = true;

Callers 1

jv_java_typeFunction · 0.85

Calls 8

jv_kindFunction · 0.85
jv_java_type_kindFunction · 0.85
jv_type_placedFunction · 0.85
jv_fieldFunction · 0.85
jv_java_is_callableFunction · 0.85
jv_member_okFunction · 0.85
jv_java_is_valueFunction · 0.85
jv_errors_leakFunction · 0.85

Tested by

no test coverage detected