aboutsummaryrefslogtreecommitdiff
path: root/interpreter.py
diff options
context:
space:
mode:
authormryouse2022-05-24 03:38:31 +0000
committermryouse2022-05-24 03:38:31 +0000
commitfe62c5ef79cdfc470351e3a9994bc6b00f40bd76 (patch)
tree8c782ae28fb7aa5e90f9531eaa457890ba743624 /interpreter.py
parent69cfd5883b6898dc613471d2639aa22ed5e8ad6f (diff)
bugfix: wrap split's items in a Literal
Diffstat (limited to 'interpreter.py')
-rw-r--r--interpreter.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/interpreter.py b/interpreter.py
index cda4c62..2721a63 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -436,7 +436,8 @@ def interpretSplit(symbol, args, env):
splitter = evaluate(args[1], env)
if not isinstance(splitter, Literal) or not isinstance(splitter.value, str):
raise Exception("'split' expects a string as it's splitter")
- return List(target.value.split(splitter.value), True)
+ ret = target.value.split(splitter.value)
+ return List([Literal(r) for r in ret], True)
GLOBALS.register("split", Builtin(interpretSplit, 2))