An unquoted expansion may split into several words. */
| 994 | |
| 995 | /* An unquoted expansion may split into several words. */ |
| 996 | static bool sh_may_split(TSNode w) { |
| 997 | const char *t = ts_node_type(w); |
| 998 | if (strcmp(t, "simple_expansion") == 0 || strcmp(t, "expansion") == 0 || |
| 999 | strcmp(t, "command_substitution") == 0) { |
| 1000 | return true; |
| 1001 | } |
| 1002 | if (strcmp(t, "concatenation") == 0) { |
| 1003 | for (uint32_t i = 0; i < ts_node_named_child_count(w); i++) { |
| 1004 | if (sh_may_split(ts_node_named_child(w, i))) { |
| 1005 | return true; |
| 1006 | } |
| 1007 | } |
| 1008 | } |
| 1009 | return false; |
| 1010 | } |
| 1011 | |
| 1012 | static void sh_argv_push(sh_argv_t *a, const char *v, bool split, uint32_t b, uint32_t e) { |
| 1013 | if (a->n >= a->cap) { |