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)
| 2139 | /// Go-embedding check is gated to Go, since c/cpp members nest their |
| 2140 | /// field_identifier inside a pointer/array/function declarator. |
| 2141 | fn extract_inheritance(&mut self, node: Node<'t>, class_row: u32) { |
| 2142 | stack_guard!(); |
| 2143 | let extends_kind = edge_kind_index("extends").unwrap(); |
| 2144 | for child in node.named_children(&mut node.walk()) { |
| 2145 | match child.kind() { |
| 2146 | "base_class_clause" => { |
| 2147 | for t in child.named_children(&mut child.walk()) { |
| 2148 | if matches!( |
| 2149 | t.kind(), |
| 2150 | "type_identifier" | "qualified_identifier" | "template_type" |
| 2151 | ) { |
| 2152 | let name = strip_cpp_template_args(self.text(t)); |
| 2153 | self.push_ref_at(class_row, &name, extends_kind, t); |
| 2154 | } |
| 2155 | } |
| 2156 | } |
| 2157 | "field_declaration_list" | "class_heritage" => { |
| 2158 | self.extract_inheritance(child, class_row); |
| 2159 | } |
| 2160 | _ => {} |
| 2161 | } |
| 2162 | } |
| 2163 | } |
| 2164 | |
| 2165 | // --- the types members and aliases are declared with -------------------- |
| 2166 |
no test coverage detected