menu page queries
This commit is contained in:
@@ -164,6 +164,14 @@ char BasicParser::peek() {
|
||||
return source[pos];
|
||||
}
|
||||
|
||||
std::string BasicParser::readUntil(char c) {
|
||||
int start = pos;
|
||||
while (hasNext() && source[pos] != c) {
|
||||
pos++;
|
||||
}
|
||||
return source.substr(start, pos-start);
|
||||
}
|
||||
|
||||
std::string BasicParser::parseName() {
|
||||
char c = peek();
|
||||
if (!is_identifier_start(c)) {
|
||||
|
||||
@@ -82,20 +82,23 @@ protected:
|
||||
bool skipTo(const std::string& substring);
|
||||
void expect(char expected);
|
||||
void expect(const std::string& substring);
|
||||
char peek();
|
||||
char nextChar();
|
||||
bool hasNext();
|
||||
bool isNext(const std::string& substring);
|
||||
void expectNewLine();
|
||||
void goBack();
|
||||
|
||||
std::string parseName();
|
||||
int64_t parseSimpleInt(int base);
|
||||
bool parseNumber(int sign, number_u& out);
|
||||
std::string parseString(char chr, bool closeRequired=true);
|
||||
|
||||
parsing_error error(std::string message);
|
||||
|
||||
public:
|
||||
std::string readUntil(char c);
|
||||
std::string parseName();
|
||||
bool hasNext();
|
||||
char peek();
|
||||
char nextChar();
|
||||
|
||||
BasicParser(const std::string& file, const std::string& source);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user