🐐 Compiler

This commit is contained in:
2026-04-10 13:06:34 +02:00
parent e2688b49ea
commit 4937a95f70
12 changed files with 1280 additions and 36 deletions

View File

@@ -622,7 +622,9 @@ class UnaryNot(Node):
def _eval(self, vtable):
vtable, val = self.expr.eval(vtable)
return vtable, ValBool(not bool(val))
if not isinstance(val, ValBool):
raise CentvrionError("NON requires a boolean")
return vtable, ValBool(not val.value())
class ArrayIndex(Node):
@@ -730,8 +732,6 @@ class DumStatement(Node):
if vtable["#return"] is not None:
break
vtable, cond = self.test.eval(vtable)
if not isinstance(cond, ValBool):
raise CentvrionError("DVM condition must be a boolean")
return vtable, last_val