🐐 SCINDE

This commit is contained in:
2026-04-22 11:48:54 +02:00
parent 0da0907a62
commit 25e88a6362
9 changed files with 72 additions and 2 deletions

View File

@@ -1328,6 +1328,18 @@ class BuiltIn(Node):
except re.error as e:
raise CentvrionError(f"Invalid regex: {e}")
return vtable, ValStr(result)
case "SCINDE":
string = params[0]
delimiter = params[1]
if not isinstance(string, ValStr) or not isinstance(delimiter, ValStr):
raise CentvrionError("SCINDE requires two strings")
s = string.value()
d = delimiter.value()
if d == "":
parts = [ValStr(c) for c in s]
else:
parts = [ValStr(p) for p in s.split(d)]
return vtable, ValList(parts)
case "PETE":
if "RETE" not in vtable["#modules"]:
raise CentvrionError("Cannot use 'PETE' without module 'RETE'")