Classify class label from AST node kind
| 2626 | |
| 2627 | // Classify class label from AST node kind |
| 2628 | static const char *class_label_for_kind(const char *kind) { |
| 2629 | if (strcmp(kind, "interface_declaration") == 0 || strcmp(kind, "interface_type") == 0 || |
| 2630 | strcmp(kind, "trait_item") == 0 || strcmp(kind, "trait_definition") == 0 || |
| 2631 | strcmp(kind, "protocol_declaration") == 0) { |
| 2632 | return "Interface"; |
| 2633 | } |
| 2634 | if (strcmp(kind, "enum_specifier") == 0 || strcmp(kind, "enum_declaration") == 0 || |
| 2635 | strcmp(kind, "enum_item") == 0) { |
| 2636 | return "Enum"; |
| 2637 | } |
| 2638 | if (strcmp(kind, "type_alias_declaration") == 0 || strcmp(kind, "type_item") == 0 || |
| 2639 | strcmp(kind, "type_alias") == 0 || strcmp(kind, "type_definition") == 0) { |
| 2640 | return "Type"; |
| 2641 | } |
| 2642 | return "Class"; |
| 2643 | } |
| 2644 | |
| 2645 | // --- Parameter type extraction --- |
| 2646 |