Make "time" a job prefix

In particular, this allows `true && time true`, or `true; and time true`,
and both `time not true` as well as `not time true` (like bash).

time is valid only as job _prefix_, so `true | time true` could call
`/bin/time` (same in bash)

See discussion in #6442
This commit is contained in:
Johannes Altmanninger
2019-12-21 11:45:07 +01:00
committed by Mahmoud Al-Qudsi
parent c1140bc436
commit 3de95038b0
13 changed files with 101 additions and 42 deletions

View File

@@ -955,7 +955,7 @@ void parse_ll_t::accept_tokens(parse_token_t token1, parse_token_t token2) {
case symbol_job:
variable_assignments =
tnode_t<grammar::job>(&nodes, parent)
.try_get_child<grammar::variable_assignments, 0>();
.try_get_child<grammar::variable_assignments, 1>();
break;
case symbol_job_continuation:
variable_assignments =