mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00
Shell: Allow control structures to appear in pipe sequences
This makes commands like the following to be possible: ```sh $ ls && for $(seq 10) { echo $it } $ ls | for $(seq 1) { cat > foobar } ```
This commit is contained in:
parent
7b5ead64a5
commit
aa2df9277d
5 changed files with 73 additions and 41 deletions
|
@ -196,6 +196,7 @@ struct Command {
|
|||
bool should_wait { true };
|
||||
bool is_pipe_source { false };
|
||||
bool should_notify_if_in_background { true };
|
||||
bool should_immediately_execute_next { false };
|
||||
|
||||
mutable RefPtr<Pipeline> pipeline;
|
||||
Vector<NodeWithAction> next_chain;
|
||||
|
@ -233,7 +234,7 @@ public:
|
|||
}
|
||||
|
||||
CommandValue(Vector<String> argv)
|
||||
: m_command({ move(argv), {}, true, false, true, nullptr, {} })
|
||||
: m_command({ move(argv), {}, true, false, true, false, nullptr, {} })
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -410,6 +411,8 @@ public:
|
|||
|
||||
virtual RefPtr<Node> leftmost_trivial_literal() const { return nullptr; }
|
||||
|
||||
Vector<Command> to_lazy_evaluated_commands(RefPtr<Shell> shell);
|
||||
|
||||
protected:
|
||||
Position m_position;
|
||||
bool m_is_syntax_error { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue