| 3198 | /* ── Scope scan: items ───────────────────────────────────────────── */ |
| 3199 | |
| 3200 | static void rs_block_push(rs_scan_t *s, TSNode node, int mod) { |
| 3201 | if (ts_node_is_null(node) || s->failed) { |
| 3202 | return; |
| 3203 | } |
| 3204 | if (s->nblocks >= s->blocks_cap) { |
| 3205 | int ncap = s->blocks_cap ? s->blocks_cap * PAIR_LEN : RS_SCAN_INIT; |
| 3206 | rs_block_t *grown = (rs_block_t *)rs_tmp_alloc(s, (size_t)ncap * sizeof(rs_block_t)); |
| 3207 | if (!grown) { |
| 3208 | return; |
| 3209 | } |
| 3210 | if (s->nblocks > 0) { |
| 3211 | memcpy(grown, s->blocks, (size_t)s->nblocks * sizeof(rs_block_t)); |
| 3212 | } |
| 3213 | s->blocks = grown; |
| 3214 | s->blocks_cap = ncap; |
| 3215 | } |
| 3216 | s->blocks[s->nblocks++] = (rs_block_t){.node = node, .mod = mod}; |
| 3217 | } |
| 3218 | |
| 3219 | /* The first fields of a T record: T mod start end flags kind name, then the |
| 3220 | * tab before the node field. */ |
no test coverage detected