1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

eatchar in parser

This commit is contained in:
Zeno Rogue 2021-10-15 22:13:52 +02:00
parent 9f9a95059a
commit 432499f903

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++;