Swift models a call as a target expression plus a call_suffix, and its grammar * declares no "arguments" field at all, so the generic field lookup finds * nothing for every Swift call. Reach the argument list through the suffix * instead. A trailing closure has a call_suffix with no value_arguments, which * returns a null node and leaves the call without a string argument, as before. */
| 3890 | * instead. A trailing closure has a call_suffix with no value_arguments, which |
| 3891 | * returns a null node and leaves the call without a string argument, as before. */ |
| 3892 | static TSNode swift_call_args(TSNode node) { |
| 3893 | TSNode suffix = cbm_find_child_by_kind(node, "call_suffix"); |
| 3894 | if (ts_node_is_null(suffix)) { |
| 3895 | return (TSNode){0}; |
| 3896 | } |
| 3897 | return cbm_find_child_by_kind(suffix, "value_arguments"); |
| 3898 | } |
| 3899 | |
| 3900 | static bool node_has_token(TSNode node, const char *token) { |
| 3901 | uint32_t count = ts_node_child_count(node); |
no test coverage detected