Build a single-element NULL-terminated base class array.
| 2101 | |
| 2102 | // Build a single-element NULL-terminated base class array. |
| 2103 | static const char **make_single_base(CBMArena *a, const char *text) { |
| 2104 | if (!text || !text[0]) { |
| 2105 | return NULL; |
| 2106 | } |
| 2107 | const char **result = (const char **)cbm_arena_alloc(a, sizeof(const char *) * RT_PAIR_SIZE); |
| 2108 | if (result) { |
| 2109 | result[0] = text; |
| 2110 | result[SKIP_CHAR] = NULL; |
| 2111 | } |
| 2112 | return result; |
| 2113 | } |
| 2114 | |
| 2115 | // Search children for a child matching one of the base_types and return its text as single base. |
| 2116 | static const char **find_base_from_children(CBMArena *a, TSNode node, const char *source, |
no test coverage detected