1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-15 18:00:04 +00:00

parser:: convenience functions rparse and iparse

This commit is contained in:
Zeno Rogue 2019-12-23 21:18:35 +01:00
parent c70c082f36
commit bce9dbda7d

View File

@ -145,6 +145,9 @@ struct exp_parser {
cld parse(int prio = 0);
ld rparse(int prio = 0) { return real(parse(prio)); }
int iparse(int prio = 0) { return int(floor(rparse(prio) + .5)); }
cld parsepar() {
cld res = parse();
if(next() != ')') { at = -1; return res; }