Process a single block_mapping_pair for kustomize list keys.
| 517 | |
| 518 | // Process a single block_mapping_pair for kustomize list keys. |
| 519 | static void process_kustomize_pair(CBMExtractCtx *ctx, TSNode pair) { |
| 520 | if (strcmp(ts_node_type(pair), "block_mapping_pair") != 0) { |
| 521 | return; |
| 522 | } |
| 523 | TSNode key_node = ts_node_named_child(pair, 0); |
| 524 | if (ts_node_is_null(key_node)) { |
| 525 | return; |
| 526 | } |
| 527 | const char *key_text = get_scalar_text(ctx->arena, key_node, ctx->source); |
| 528 | if (!key_text) { |
| 529 | return; |
| 530 | } |
| 531 | TSNode val_node = unwrap_pair_value(pair); |
| 532 | if (ts_node_is_null(val_node) || strcmp(ts_node_type(val_node), "block_sequence") != 0) { |
| 533 | return; |
| 534 | } |
| 535 | if (strcmp(key_text, "helmCharts") == 0) { |
| 536 | emit_kustomize_charts(ctx, val_node); |
| 537 | return; |
| 538 | } |
| 539 | if (!is_kustomize_list_key(key_text)) { |
| 540 | return; |
| 541 | } |
| 542 | emit_kustomize_sequence(ctx, val_node, key_text); |
| 543 | if (strcmp(key_text, "patches") == 0) { |
| 544 | emit_kustomize_patches(ctx, val_node); |
| 545 | } |
| 546 | } |
| 547 | |
| 548 | // Emit a "Class" def named after the document's `kind` scalar. A kustomization |
| 549 | // file has no metadata.name, so the def name is the bare kind ("Kustomization"). |
no test coverage detected