mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:37:45 +00:00
Add clang-format file
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
This commit is contained in:
parent
c11351ac50
commit
0dc9af5f7e
286 changed files with 3244 additions and 2424 deletions
|
@ -4,11 +4,18 @@
|
|||
#include <AK/Vector.h>
|
||||
|
||||
struct Redirection {
|
||||
enum Type { Pipe, FileWrite, FileWriteAppend, FileRead, Rewire };
|
||||
enum Type
|
||||
{
|
||||
Pipe,
|
||||
FileWrite,
|
||||
FileWriteAppend,
|
||||
FileRead,
|
||||
Rewire
|
||||
};
|
||||
Type type;
|
||||
int fd { -1 };
|
||||
int rewire_fd { -1 };
|
||||
String path { };
|
||||
String path {};
|
||||
};
|
||||
|
||||
struct Subcommand {
|
||||
|
@ -18,7 +25,10 @@ struct Subcommand {
|
|||
|
||||
class Parser {
|
||||
public:
|
||||
explicit Parser(const String& input) : m_input(input) { }
|
||||
explicit Parser(const String& input)
|
||||
: m_input(input)
|
||||
{
|
||||
}
|
||||
|
||||
Vector<Subcommand> parse();
|
||||
|
||||
|
@ -29,7 +39,8 @@ private:
|
|||
void begin_redirect_read(int fd);
|
||||
void begin_redirect_write(int fd);
|
||||
|
||||
enum State {
|
||||
enum State
|
||||
{
|
||||
Free,
|
||||
InSingleQuotes,
|
||||
InDoubleQuotes,
|
||||
|
@ -44,4 +55,3 @@ private:
|
|||
Vector<Redirection> m_redirections;
|
||||
Vector<char> m_token;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue