Record hit `x` of command `cmd`: its file, line and CI context are the * state's; ext / path are copied. */
| 1311 | /* Record hit `x` of command `cmd`: its file, line and CI context are the |
| 1312 | * state's; ext / path are copied. */ |
| 1313 | static void sh_hit_push(sh_t *s, TSNode cmd, sh_hit_t x) { |
| 1314 | sh_hits_t *h = s->hits; |
| 1315 | if (!sh_grow((void **)&h->items, &h->cap, h->count, sizeof(*h->items))) { |
| 1316 | return; |
| 1317 | } |
| 1318 | x.file = s->file; |
| 1319 | x.line = (int)ts_node_start_point(cmd).row + SKIP_ONE + s->line_base; |
| 1320 | x.ext = x.ext ? cbm_arena_strdup(&h->arena, x.ext) : NULL; |
| 1321 | x.path = x.path ? cbm_arena_strdup(&h->arena, x.path) : NULL; |
| 1322 | x.ci = s->ci; |
| 1323 | x.job = s->job ? cbm_arena_strdup(&h->arena, s->job) : NULL; |
| 1324 | h->items[h->count++] = x; |
| 1325 | } |
| 1326 | |
| 1327 | static void sh_hit(sh_t *s, TSNode cmd, const char *via, const sh_target_t *t, const char *ext, |
| 1328 | bool chart) { |