| 70 | * ══════════════════════════════════════════════════════════════════ */ |
| 71 | |
| 72 | static void lex_push(cbm_lex_result_t *r, cbm_token_type_t type, const char *text, int pos) { |
| 73 | if (r->count >= r->capacity) { |
| 74 | r->capacity = r->capacity ? r->capacity * PAIR_LEN : CBM_SZ_32; |
| 75 | r->tokens = safe_realloc(r->tokens, r->capacity * sizeof(cbm_token_t)); |
| 76 | } |
| 77 | r->tokens[r->count++] = (cbm_token_t){.type = type, .text = heap_strdup(text), .pos = pos}; |
| 78 | } |
| 79 | |
| 80 | static void lex_push_n(cbm_lex_result_t *r, cbm_token_type_t type, const char *start, size_t len, |
| 81 | int pos) { |
no test coverage detected