| 604 | } |
| 605 | |
| 606 | static const char *resolve_as_class(const cbm_registry_t *reg, const char *name, |
| 607 | const char *module_qn, const char **imp_keys, |
| 608 | const char **imp_vals, int imp_count, CBMLanguage lang) { |
| 609 | cbm_resolution_t res = |
| 610 | cbm_registry_resolve_lang(reg, name, module_qn, imp_keys, imp_vals, imp_count, lang); |
| 611 | if (!res.qualified_name || res.qualified_name[0] == '\0') { |
| 612 | return NULL; |
| 613 | } |
| 614 | /* Accept any type-like container (Class/Struct/Interface/Enum/Type/Trait): |
| 615 | * base classes, Rust `impl Trait for S` struct receivers, and Go struct |
| 616 | * embedding all resolve through here. Struct included so the struct receiver |
| 617 | * of an IMPLEMENTS edge is not dropped. */ |
| 618 | const char *label = cbm_registry_label_of(reg, res.qualified_name); |
| 619 | if (!cbm_label_is_type_like(label)) { |
| 620 | return NULL; |
| 621 | } |
| 622 | return res.qualified_name; |
| 623 | } |
| 624 | |
| 625 | static void extract_decorator_func(const char *dec, char *out, size_t outsz) { |
| 626 | out[0] = '\0'; |
no test coverage detected