mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-26 00:47:00 +00:00
eatchar in parser
This commit is contained in:
parent
9f9a95059a
commit
432499f903
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++;
|
||||||
|
Loading…
Reference in New Issue
Block a user