From 0c7a4299850b449b2b06560f79b0e4a528ae0359 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 24 Apr 2022 22:10:43 +0200 Subject: [PATCH] parser:: ifz function --- util.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/util.cpp b/util.cpp index 018f6fbf..979b7269 100644 --- a/util.cpp +++ b/util.cpp @@ -323,6 +323,14 @@ cld exp_parser::parse(int prio) { cld no = parsepar(); res = real(cond) > 0 ? yes : no; } + else if(eat("ifz(")) { + cld cond = parse(0); + force_eat(","); + cld yes = parse(0); + force_eat(","); + cld no = parsepar(); + res = abs(cond) < 1e-8 ? yes : no; + } else if(eat("wallif(")) { cld val0 = parse(0); force_eat(",");