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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user