mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
Shell: Fix job control and backgrounding
This patchset makes the shell capable of lazily resolving and executing sequences of commands, to allow for putting logical sequences in the background. In particular, it enables And/Or/Sequence nodes to be run in the background, and consequently unmarks them as `would_execute`. Doing so also fixes job control to an extent, as jobs are now capable of having 'tails', so sequences can be put in the background while preserving their following sequences.
This commit is contained in:
parent
a2a54f459f
commit
715e11f692
10 changed files with 180 additions and 151 deletions
|
@ -283,7 +283,7 @@ RefPtr<AST::Node> Parser::parse_or_logical_sequence()
|
|||
if (!right_and_sequence)
|
||||
right_and_sequence = create<AST::SyntaxError>("Expected an expression after '||'");
|
||||
|
||||
return create<AST::Or>(create<AST::Execute>(move(and_sequence)), create<AST::Execute>(move(right_and_sequence)));
|
||||
return create<AST::Or>(move(and_sequence), move(right_and_sequence));
|
||||
}
|
||||
|
||||
RefPtr<AST::Node> Parser::parse_and_logical_sequence()
|
||||
|
@ -305,7 +305,7 @@ RefPtr<AST::Node> Parser::parse_and_logical_sequence()
|
|||
if (!right_and_sequence)
|
||||
right_and_sequence = create<AST::SyntaxError>("Expected an expression after '&&'");
|
||||
|
||||
return create<AST::And>(create<AST::Execute>(move(pipe_sequence)), create<AST::Execute>(move(right_and_sequence)));
|
||||
return create<AST::And>(move(pipe_sequence), move(right_and_sequence));
|
||||
}
|
||||
|
||||
RefPtr<AST::Node> Parser::parse_pipe_sequence()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue