mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-27 10:35:16 +00:00
eatchar in parser
This commit is contained in:
4
util.cpp
4
util.cpp
@@ -107,6 +107,10 @@ struct exp_parser {
|
|||||||
bool ok() { return at == isize(s); }
|
bool ok() { return at == isize(s); }
|
||||||
char next(int step=0) { if(at >= isize(s)-step) return 0; else return s[at+step]; }
|
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) {
|
bool eat(const char *c) {
|
||||||
int orig_at = at;
|
int orig_at = at;
|
||||||
while(*c && *c == next()) at++, c++;
|
while(*c && *c == next()) at++, c++;
|
||||||
|
|||||||
Reference in New Issue
Block a user