Append a base name (generic args stripped) to out[] if non-empty.
| 2199 | |
| 2200 | // Append a base name (generic args stripped) to out[] if non-empty. |
| 2201 | static void push_base_text(CBMArena *a, TSNode n, const char *source, const char **out, int out_cap, |
| 2202 | int *count) { |
| 2203 | if (*count >= out_cap) { |
| 2204 | return; |
| 2205 | } |
| 2206 | char *t = cbm_node_text(a, n, source); |
| 2207 | if (!t) { |
| 2208 | return; |
| 2209 | } |
| 2210 | char *angle = strchr(t, '<'); |
| 2211 | if (angle) { |
| 2212 | *angle = '\0'; |
| 2213 | } |
| 2214 | /* PHP qualified base may be backslash-prefixed (e.g. `\RuntimeException`); |
| 2215 | * keep the bare class name so it matches the unqualified declaration. */ |
| 2216 | char *last_bs = strrchr(t, '\\'); |
| 2217 | if (last_bs) { |
| 2218 | t = last_bs + 1; |
| 2219 | } |
| 2220 | if (t[0]) { |
| 2221 | out[(*count)++] = t; |
| 2222 | } |
| 2223 | } |
| 2224 | |
| 2225 | /* TypeScript/TSX: bases live in a `class_heritage` (class) or directly in an |
| 2226 | * `extends_type_clause` (interface). The extractor previously captured the |
no test coverage detected