🐐 NVLLVUS fix

This commit is contained in:
2026-04-22 12:35:00 +02:00
parent 791ed2491e
commit c55a63f46c
3 changed files with 35 additions and 4 deletions

View File

@@ -133,8 +133,11 @@ def int_to_num(n, m, s=False) -> str:
for i in thousands_chars
])
return thousands + int_to_num(n % 1000, m, s)
remainder = n % 1000
return thousands + (int_to_num(remainder, m, s) if remainder else "")
else:
if n == 0:
return "NVLLVS"
nums = []
while n > 0:
for num, i in list(NUMERALS.items())[::-1]:
@@ -779,8 +782,14 @@ class BinOp(Node):
raise CentvrionError("Cannot compare strings or arrays with PLVS")
return vtable, ValBool((lv or 0) > (rv or 0))
case "KEYWORD_EST":
if ((isinstance(left, ValInt) and lv == 0 and isinstance(right, ValNul)) or
(isinstance(left, ValNul) and isinstance(right, ValInt) and rv == 0)):
return vtable, ValBool(True)
return vtable, ValBool(lv == rv)
case "KEYWORD_DISPAR":
if ((isinstance(left, ValInt) and lv == 0 and isinstance(right, ValNul)) or
(isinstance(left, ValNul) and isinstance(right, ValInt) and rv == 0)):
return vtable, ValBool(False)
return vtable, ValBool(lv != rv)
case "KEYWORD_ET":
return vtable, ValBool(bool(left) and bool(right))