| 1295 | } |
| 1296 | |
| 1297 | static const char *extract_nth_string_arg(CBMExtractCtx *ctx, TSNode args, uint32_t n) { |
| 1298 | uint32_t nc = ts_node_named_child_count(args); |
| 1299 | uint32_t found = 0; |
| 1300 | for (uint32_t ai = 0; ai < nc && ai < MAX_POSITIONAL_SCAN + n; ai++) { |
| 1301 | TSNode arg = ts_node_named_child(args, ai); |
| 1302 | const char *ak = ts_node_type(arg); |
| 1303 | if (is_string_like(ak)) { |
| 1304 | if (found == n) { |
| 1305 | char *text = cbm_node_text(ctx->arena, arg, ctx->source); |
| 1306 | return strip_and_validate_string_arg(ctx->arena, text); |
| 1307 | } |
| 1308 | found++; |
| 1309 | } |
| 1310 | } |
| 1311 | return NULL; |
| 1312 | } |
| 1313 | |
| 1314 | // --- Unified handler: called once per node by the cursor walk --- |
| 1315 |
no test coverage detected