mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-06-22 21:23:18 +00:00
parser:: convenience functions rparse and iparse
This commit is contained in:
parent
c70c082f36
commit
bce9dbda7d
3
util.cpp
3
util.cpp
|
@ -145,6 +145,9 @@ struct exp_parser {
|
||||||
|
|
||||||
cld parse(int prio = 0);
|
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 parsepar() {
|
||||||
cld res = parse();
|
cld res = parse();
|
||||||
if(next() != ')') { at = -1; return res; }
|
if(next() != ')') { at = -1; return res; }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user