| 2645 | } |
| 2646 | |
| 2647 | static void sh_case(sh_t *s, TSNode n) { |
| 2648 | TSNode value = ts_node_child_by_field_name(n, TS_FIELD("value")); |
| 2649 | if (!ts_node_is_null(value)) { |
| 2650 | sh_walk_substs(s, value); /* case "$(cmd)" in */ |
| 2651 | } |
| 2652 | sh_touch_t t = {0}; |
| 2653 | for (uint32_t i = 0; i < ts_node_named_child_count(n); i++) { |
| 2654 | TSNode item = ts_node_named_child(n, i); |
| 2655 | if (!sh_type(item, "case_item")) { |
| 2656 | continue; |
| 2657 | } |
| 2658 | sh_mark_t m = sh_mark(s); |
| 2659 | for (uint32_t j = 0; j < ts_node_child_count(item); j++) { |
| 2660 | TSNode c = ts_node_child(item, j); |
| 2661 | if (ts_node_is_named(c) && !sh_eq(ts_node_field_name_for_child(item, j), "value")) { |
| 2662 | sh_walk(s, c); |
| 2663 | } |
| 2664 | } |
| 2665 | sh_clause_end(s, m, &t); |
| 2666 | } |
| 2667 | sh_group_end(s, &t); |
| 2668 | } |
| 2669 | |
| 2670 | /* A loop's body runs zero or more times, with its variable unknown. */ |
| 2671 | static void sh_loop(sh_t *s, TSNode n) { |
no test coverage detected