1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-21 00:47:40 +00:00

parser:: error handling now uses exceptions

This commit is contained in:
Zeno Rogue
2019-12-23 21:44:51 +01:00
parent a83220c34e
commit 15000034fd
6 changed files with 63 additions and 29 deletions

View File

@@ -833,7 +833,13 @@ EX void applymodel(hyperpoint H, hyperpoint& ret) {
ep.extra_params["uy"] = H[1];
ep.extra_params["uz"] = H[2];
ep.s = models::formula;
cld res = ep.parse();
cld res;
try {
res = ep.parse();
}
catch(hr_parse_exception&) {
res = 0;
}
ret[0] = real(res);
ret[1] = imag(res);
ret[2] = 0;