Build a single-element NULL-terminated base class array.
| 3857 | |
| 3858 | // Build a single-element NULL-terminated base class array. |
| 3859 | static const char **make_single_base(CBMArena *a, const char *text) { |
| 3860 | if (!text || !text[0]) { |
| 3861 | return NULL; |
| 3862 | } |
| 3863 | const char **result = (const char **)cbm_arena_alloc(a, sizeof(const char *) * RT_PAIR_SIZE); |
| 3864 | if (result) { |
| 3865 | result[0] = text; |
| 3866 | result[SKIP_CHAR] = NULL; |
| 3867 | } |
| 3868 | return result; |
| 3869 | } |
| 3870 | |
| 3871 | // Search children for a child matching one of the base_types and return its text as single base. |
| 3872 | static const char **find_base_from_children(CBMArena *a, TSNode node, const char *source, |
no test coverage detected