mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:57:34 +00:00
Shell: Support semicolons for separating commands
This commit is contained in:
parent
3e6a0a0533
commit
6bb6176762
3 changed files with 201 additions and 175 deletions
|
@ -27,6 +27,10 @@ struct Subcommand {
|
|||
Vector<Rewiring> rewirings;
|
||||
};
|
||||
|
||||
struct Command {
|
||||
Vector<Subcommand> subcommands;
|
||||
};
|
||||
|
||||
class Parser {
|
||||
public:
|
||||
explicit Parser(const String& input)
|
||||
|
@ -34,11 +38,12 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
Vector<Subcommand> parse();
|
||||
Vector<Command> parse();
|
||||
|
||||
private:
|
||||
void commit_token();
|
||||
void commit_subcommand();
|
||||
void commit_command();
|
||||
void do_pipe();
|
||||
void begin_redirect_read(int fd);
|
||||
void begin_redirect_write(int fd);
|
||||
|
@ -53,6 +58,7 @@ private:
|
|||
State m_state { Free };
|
||||
String m_input;
|
||||
|
||||
Vector<Command> m_commands;
|
||||
Vector<Subcommand> m_subcommands;
|
||||
Vector<String> m_tokens;
|
||||
Vector<Redirection> m_redirections;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue