Append a base name (generic args stripped) to out[] if non-empty.
| 3955 | |
| 3956 | // Append a base name (generic args stripped) to out[] if non-empty. |
| 3957 | static void push_base_text(CBMArena *a, TSNode n, const char *source, const char **out, int out_cap, |
| 3958 | int *count) { |
| 3959 | if (*count >= out_cap) { |
| 3960 | return; |
| 3961 | } |
| 3962 | char *t = cbm_node_text(a, n, source); |
| 3963 | if (!t) { |
| 3964 | return; |
| 3965 | } |
| 3966 | char *angle = strchr(t, '<'); |
| 3967 | if (angle) { |
| 3968 | *angle = '\0'; |
| 3969 | } |
| 3970 | /* PHP qualified base may be backslash-prefixed (e.g. `\RuntimeException`); |
| 3971 | * keep the bare class name so it matches the unqualified declaration. */ |
| 3972 | char *last_bs = strrchr(t, '\\'); |
| 3973 | if (last_bs) { |
| 3974 | t = last_bs + 1; |
| 3975 | } |
| 3976 | if (t[0]) { |
| 3977 | out[(*count)++] = t; |
| 3978 | } |
| 3979 | } |
| 3980 | |
| 3981 | /* TypeScript/TSX: bases live in a `class_heritage` (class) or directly in an |
| 3982 | * `extends_type_clause` (interface). The extractor previously captured the |
no test coverage detected