🐐 Compiler
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user