CommandsRepository
This commit is contained in:
@@ -154,8 +154,13 @@ void BasicParser::expectNewLine() {
|
||||
}
|
||||
}
|
||||
|
||||
void BasicParser::goBack() {
|
||||
if (pos) pos--;
|
||||
void BasicParser::goBack(size_t count) {
|
||||
if (pos < count) {
|
||||
throw std::runtime_error("pos < jump");
|
||||
}
|
||||
if (pos) {
|
||||
pos -= count;
|
||||
}
|
||||
}
|
||||
|
||||
char BasicParser::peek() {
|
||||
|
||||
@@ -86,7 +86,7 @@ protected:
|
||||
void expect(const std::string& substring);
|
||||
bool isNext(const std::string& substring);
|
||||
void expectNewLine();
|
||||
void goBack();
|
||||
void goBack(size_t count=1);
|
||||
|
||||
int64_t parseSimpleInt(int base);
|
||||
dynamic::Value parseNumber(int sign);
|
||||
|
||||
Reference in New Issue
Block a user