Go structs keep their field_declaration nodes one level below the body that * find_class_body() returns: type_spec's `type` child is a struct_type whose * only named child is a field_declaration_list. Interfaces need no such step -- * interface_type holds its method specs directly, which is why interface members * extracted correctly while every struct field was silently skipped. Normalize *
| 8237 | * extracted correctly while every struct field was silently skipped. Normalize |
| 8238 | * here, the same way the Java enum_body_declarations step above does. */ |
| 8239 | static TSNode go_normalize_struct_body(TSNode body) { |
| 8240 | if (ts_node_is_null(body) || strcmp(ts_node_type(body), "struct_type") != 0) { |
| 8241 | return body; |
| 8242 | } |
| 8243 | TSNode list = cbm_find_child_by_kind(body, "field_declaration_list"); |
| 8244 | return ts_node_is_null(list) ? body : list; |
| 8245 | } |
| 8246 | |
| 8247 | // Dart: resolve method name from method_signature/function_signature. |
| 8248 | static TSNode resolve_dart_method_name(TSNode child, const char *ck) { |
no test coverage detected