extractInheritance — the branches whose node kinds occur in the c/cpp grammars: base_class_clause (#1043) and the field_declaration_list recursion. A member `field_declaration` is never a supertype: the TS Go-embedding check is gated to Go, since c/cpp members nest their field_identifier inside a pointer/array/function declarator.
(&mut self, node: Node<'t>, class_row: u32)
| 2152 | /// Go-embedding check is gated to Go, since c/cpp members nest their |
| 2153 | /// field_identifier inside a pointer/array/function declarator. |
| 2154 | fn extract_inheritance(&mut self, node: Node<'t>, class_row: u32) { |
| 2155 | stack_guard!(); |
| 2156 | let extends_kind = edge_kind_index("extends").unwrap(); |
| 2157 | for i in 0..node.named_child_count() { |
| 2158 | let Some(child) = node.named_child(i) else { continue }; |
| 2159 | match child.kind() { |
| 2160 | "base_class_clause" => { |
| 2161 | for j in 0..child.named_child_count() { |
| 2162 | let Some(t) = child.named_child(j) else { continue }; |
| 2163 | if matches!( |
| 2164 | t.kind(), |
| 2165 | "type_identifier" | "qualified_identifier" | "template_type" |
| 2166 | ) { |
| 2167 | let name = strip_cpp_template_args(self.text(t)); |
| 2168 | self.push_ref_at(class_row, &name, extends_kind, t); |
| 2169 | } |
| 2170 | } |
| 2171 | } |
| 2172 | "field_declaration_list" | "class_heritage" => { |
| 2173 | self.extract_inheritance(child, class_row); |
| 2174 | } |
| 2175 | _ => {} |
| 2176 | } |
| 2177 | } |
| 2178 | } |
| 2179 | |
| 2180 | // --- the types members and aliases are declared with -------------------- |
| 2181 |
no test coverage detected