Resolve the identifier node from a destructure pattern child. * pair_pattern → value field; shorthand/identifier → itself; others → first named child. */
| 4618 | /* Resolve the identifier node from a destructure pattern child. |
| 4619 | * pair_pattern → value field; shorthand/identifier → itself; others → first named child. */ |
| 4620 | static TSNode destructure_ident(TSNode pat_child) { |
| 4621 | const char *pk = ts_node_type(pat_child); |
| 4622 | if (strcmp(pk, "shorthand_property_identifier_pattern") == 0 || strcmp(pk, "identifier") == 0) { |
| 4623 | return pat_child; |
| 4624 | } |
| 4625 | if (strcmp(pk, "pair_pattern") == 0) { |
| 4626 | return ts_node_child_by_field_name(pat_child, TS_FIELD("value")); |
| 4627 | } |
| 4628 | /* rest_pattern, assignment_pattern, etc. — first named child. */ |
| 4629 | return ts_node_named_child(pat_child, 0); |
| 4630 | } |
| 4631 | |
| 4632 | /* Emit individual Variable nodes for each destructured binding. */ |
| 4633 | static void extract_destructured_vars(CBMExtractCtx *ctx, TSNode pattern, TSNode decl, |
no outgoing calls
no test coverage detected