1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-16 10:14:48 +00:00

parser accepts inf

This commit is contained in:
Zeno Rogue 2022-04-21 22:09:04 +02:00
parent 592605c6e2
commit 506a8b8f1b

View File

@ -344,6 +344,7 @@ cld exp_parser::parse(int prio) {
else if (auto *p = hr::at_or_null(params, number)) res = (*p)->get_cld(); else if (auto *p = hr::at_or_null(params, number)) res = (*p)->get_cld();
else if(number == "e") res = exp(1); else if(number == "e") res = exp(1);
else if(number == "i") res = cld(0, 1); else if(number == "i") res = cld(0, 1);
else if(number == "inf") res = HUGE_VAL;
else if(number == "p" || number == "pi") res = M_PI; else if(number == "p" || number == "pi") res = M_PI;
else if(number == "" && next() == '-') { at++; res = -parse(20); } else if(number == "" && next() == '-') { at++; res = -parse(20); }
else if(number == "") throw hr_parse_exception("number missing, " + where()); else if(number == "") throw hr_parse_exception("number missing, " + where());