diff options
Diffstat (limited to 'src/operator-store.cc')
-rw-r--r-- | src/operator-store.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/operator-store.cc b/src/operator-store.cc index 23d97e2..06e0e3a 100644 --- a/src/operator-store.cc +++ b/src/operator-store.cc @@ -120,58 +120,58 @@ Operator::ProcessResult StoreOperator::process(Depot &depot, Request &command) return ProcessResult::OK; } -Parser::ParseResult StoreOperator::parse(Request &c_in) +Parser::ParseResult StoreOperator::parse(Request &c_in, Parser &p) { constexpr auto ACCEPT = Parser::ParseResult::ACCEPT; Session &session = Session::getInstance(); Parser::ParseResult res; - if ((res = expectSPACE()) != ACCEPT) { + if ((res = p.expectSPACE()) != ACCEPT) { session.setLastError("Expected SPACE"); return res; } - if ((res = expectSet(c_in.getSet())) != ACCEPT) { + if ((res = p.expectSet(c_in.getSet())) != ACCEPT) { session.setLastError("Expected Set"); return res; } - if ((res = expectSPACE()) != ACCEPT) { + if ((res = p.expectSPACE()) != ACCEPT) { session.setLastError("Expected SPACE"); return res; } string mode; - if ((res = expectThisString("+")) == ACCEPT) + if ((res = p.expectThisString("+")) == ACCEPT) mode = "+"; - else if ((res = expectThisString("-")) == ACCEPT) + else if ((res = p.expectThisString("-")) == ACCEPT) mode = "-"; - if ((res = expectThisString("FLAGS")) != ACCEPT) { + if ((res = p.expectThisString("FLAGS")) != ACCEPT) { session.setLastError("Expected FLAGS"); return res; } else { mode += "FLAGS"; } - if ((res = expectThisString(".SILENT")) == ACCEPT) mode += ".SILENT"; + if ((res = p.expectThisString(".SILENT")) == ACCEPT) mode += ".SILENT"; c_in.setMode(mode); - if ((res = expectSPACE()) != ACCEPT) { + if ((res = p.expectSPACE()) != ACCEPT) { session.setLastError("Expected SPACE"); return res; } bool paren = false; - if ((res = expectThisString("(")) == ACCEPT) paren = true; + if ((res = p.expectThisString("(")) == ACCEPT) paren = true; - if ((res = expectFlag(c_in.getFlags())) == ACCEPT) { + if ((res = p.expectFlag(c_in.getFlags())) == ACCEPT) { while (1) { - if ((res = expectSPACE()) != ACCEPT) break; + if ((res = p.expectSPACE()) != ACCEPT) break; - if ((res = expectFlag(c_in.getFlags())) != ACCEPT) { + if ((res = p.expectFlag(c_in.getFlags())) != ACCEPT) { session.setLastError("Expected flag after SPACE"); return res; } @@ -179,13 +179,13 @@ Parser::ParseResult StoreOperator::parse(Request &c_in) } if (paren) { - if ((res = expectThisString(")")) != ACCEPT) { + if ((res = p.expectThisString(")")) != ACCEPT) { session.setLastError("Expected )"); return res; } } - if ((res = expectCRLF()) != ACCEPT) { + if ((res = p.expectCRLF()) != ACCEPT) { session.setLastError("Expected CRLF"); return res; } |