Resolve the identifier node from a destructure pattern child. * pair_pattern → value field; shorthand/identifier → itself; others → first named child. */
| 9192 | /* Resolve the identifier node from a destructure pattern child. |
| 9193 | * pair_pattern → value field; shorthand/identifier → itself; others → first named child. */ |
| 9194 | static TSNode destructure_ident(TSNode pat_child) { |
| 9195 | const char *pk = ts_node_type(pat_child); |
| 9196 | if (strcmp(pk, "shorthand_property_identifier_pattern") == 0 || strcmp(pk, "identifier") == 0) { |
| 9197 | return pat_child; |
| 9198 | } |
| 9199 | if (strcmp(pk, "pair_pattern") == 0) { |
| 9200 | return ts_node_child_by_field_name(pat_child, TS_FIELD("value")); |
| 9201 | } |
| 9202 | /* rest_pattern, assignment_pattern, etc. — first named child. */ |
| 9203 | return ts_node_named_child(pat_child, 0); |
| 9204 | } |
| 9205 | |
| 9206 | /* Emit individual Variable nodes for each destructured binding. */ |
| 9207 | static void extract_destructured_vars(CBMExtractCtx *ctx, TSNode pattern, TSNode decl, |
no outgoing calls
no test coverage detected