eatchar in parser

This commit is contained in:
Zeno Rogue 2021-10-15 22:13:52 +02:00
parent 9f9a95059a
commit 432499f903
1 changed files with 4 additions and 0 deletions

View File

@ -107,6 +107,10 @@ struct exp_parser {
bool ok() { return at == isize(s); }
char next(int step=0) { if(at >= isize(s)-step) return 0; else return s[at+step]; }
char eatchar() {
return s[at++];
}
bool eat(const char *c) {
int orig_at = at;
while(*c && *c == next()) at++, c++;