| 1032 | } |
| 1033 | |
| 1034 | static void dk_run(dk_t *d, TSNode ins) { |
| 1035 | if (d->stage >= DK_MAX_STAGES) { |
| 1036 | return; |
| 1037 | } |
| 1038 | for (uint32_t i = 0; i < ts_node_named_child_count(ins); i++) { |
| 1039 | TSNode sc = ts_node_named_child(ins, i); |
| 1040 | if (!dk_type(sc, "shell_command")) { |
| 1041 | continue; |
| 1042 | } |
| 1043 | /* command lists split at && || ; (as written, quotes or not) */ |
| 1044 | const char *p = d->src + ts_node_start_byte(sc); |
| 1045 | const char *end = d->src + ts_node_end_byte(sc); |
| 1046 | while (p < end) { |
| 1047 | const char *q = p; |
| 1048 | while (q < end && |
| 1049 | !(q + SKIP_ONE < end && ((q[0] == '&' && q[SKIP_ONE] == '&') || |
| 1050 | (q[0] == '|' && q[SKIP_ONE] == '|'))) && |
| 1051 | *q != ';') { |
| 1052 | q++; |
| 1053 | } |
| 1054 | const char *w[DK_MAX_WORDS]; |
| 1055 | int n = dk_words(d, p, q, w, DK_MAX_WORDS); |
| 1056 | dk_go_builds(d, w, n); |
| 1057 | p = q < end ? q + (*q == ';' ? SKIP_ONE : PAIR_LEN) : end; |
| 1058 | } |
| 1059 | } |
| 1060 | } |
| 1061 | |
| 1062 | static void dk_workdir(dk_t *d, TSNode ins) { |
| 1063 | for (uint32_t i = 0; i < ts_node_named_child_count(ins); i++) { |
no test coverage detected