🐐 Fixing latin
This commit is contained in:
@@ -935,7 +935,7 @@ class SiStatement(Node):
|
||||
result = f"SI {self.test.print()} TVNC {{\n{body}\n}}"
|
||||
if self.else_part:
|
||||
else_body = "\n".join(s.print() for s in self.else_part)
|
||||
result += f" ALVID {{\n{else_body}\n}}"
|
||||
result += f" ALIVD {{\n{else_body}\n}}"
|
||||
return result
|
||||
|
||||
def _eval(self, vtable):
|
||||
@@ -972,7 +972,7 @@ class DumStatement(Node):
|
||||
|
||||
def print(self):
|
||||
body = "\n".join(s.print() for s in self.statements)
|
||||
return f"DVM {self.test.print()} FACE {{\n{body}\n}}"
|
||||
return f"DVM {self.test.print()} FAC {{\n{body}\n}}"
|
||||
|
||||
def _eval(self, vtable):
|
||||
last_val = ValNul()
|
||||
@@ -1016,7 +1016,7 @@ class PerStatement(Node):
|
||||
|
||||
def print(self):
|
||||
body = "\n".join(s.print() for s in self.statements)
|
||||
return f"PER {self.variable_name.print()} IN {self.data_list.print()} FACE {{\n{body}\n}}"
|
||||
return f"PER {self.variable_name.print()} IN {self.data_list.print()} FAC {{\n{body}\n}}"
|
||||
|
||||
def _eval(self, vtable):
|
||||
vtable, array = self.data_list.eval(vtable)
|
||||
@@ -1158,7 +1158,7 @@ class BuiltIn(Node):
|
||||
raise CentvrionError(f"Invalid numeral input: {raw!r}")
|
||||
case "AVDI":
|
||||
return vtable, ValStr(input())
|
||||
case "DICE":
|
||||
case "DIC":
|
||||
print_string = ' '.join(
|
||||
make_string(i, magnvm, svbnvlla) for i in params
|
||||
)
|
||||
@@ -1167,23 +1167,23 @@ class BuiltIn(Node):
|
||||
case "ERVMPE":
|
||||
vtable["#break"] = True
|
||||
return vtable, ValNul()
|
||||
case "FORTIS_NVMERVS":
|
||||
case "FORTVITVS_NVMERVS":
|
||||
if "FORS" not in vtable["#modules"]:
|
||||
raise CentvrionError("Cannot use 'FORTIS_NVMERVS' without module 'FORS'")
|
||||
raise CentvrionError("Cannot use 'FORTVITVS_NVMERVS' without module 'FORS'")
|
||||
a, b = params[0].value(), params[1].value()
|
||||
if not isinstance(a, int) or not isinstance(b, int):
|
||||
raise CentvrionError("FORTIS_NVMERVS requires two numbers")
|
||||
raise CentvrionError("FORTVITVS_NVMERVS requires two numbers")
|
||||
if a > b:
|
||||
raise CentvrionError(f"FORTIS_NVMERVS: first argument ({a}) must be ≤ second ({b})")
|
||||
raise CentvrionError(f"FORTVITVS_NVMERVS: first argument ({a}) must be ≤ second ({b})")
|
||||
return vtable, ValInt(random.randint(a, b))
|
||||
case "FORTIS_ELECTIONIS":
|
||||
case "FORTVITA_ELECTIO":
|
||||
if "FORS" not in vtable["#modules"]:
|
||||
raise CentvrionError("Cannot use 'FORTIS_ELECTIONIS' without module 'FORS'")
|
||||
raise CentvrionError("Cannot use 'FORTVITA_ELECTIO' without module 'FORS'")
|
||||
if not isinstance(params[0], ValList):
|
||||
raise CentvrionError("FORTIS_ELECTIONIS requires an array")
|
||||
raise CentvrionError("FORTVITA_ELECTIO requires an array")
|
||||
lst = params[0].value()
|
||||
if len(lst) == 0:
|
||||
raise CentvrionError("FORTIS_ELECTIONIS: cannot select from an empty array")
|
||||
raise CentvrionError("FORTVITA_ELECTIO: cannot select from an empty array")
|
||||
return vtable, lst[random.randint(0, len(lst) - 1)]
|
||||
case "SEMEN":
|
||||
if "FORS" not in vtable["#modules"]:
|
||||
@@ -1222,7 +1222,7 @@ class BuiltIn(Node):
|
||||
raise CentvrionError("CLAVES requires a dict")
|
||||
keys = [ValStr(k) if isinstance(k, str) else ValInt(k) for k in params[0].value().keys()]
|
||||
return vtable, ValList(keys)
|
||||
case "EVERRO":
|
||||
case "EVERRE":
|
||||
print("\033[2J\033[H", end="", flush=True)
|
||||
return vtable, ValNul()
|
||||
case "ORDINA":
|
||||
|
||||
Reference in New Issue
Block a user