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. */
| 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. */ |
| 2086 | static 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 | |
| 2112 | static void jv_java_put_supers(jv_scan_t *s, TSNode decl) { |
| 2113 | bool first = true; |
no test coverage detected