diff options
| author | mryouse | 2022-05-24 03:38:31 +0000 |
|---|---|---|
| committer | mryouse | 2022-05-24 03:38:31 +0000 |
| commit | fe62c5ef79cdfc470351e3a9994bc6b00f40bd76 (patch) | |
| tree | 8c782ae28fb7aa5e90f9531eaa457890ba743624 /interpreter.py | |
| parent | 69cfd5883b6898dc613471d2639aa22ed5e8ad6f (diff) | |
bugfix: wrap split's items in a Literal
Diffstat (limited to 'interpreter.py')
| -rw-r--r-- | interpreter.py | 3 |
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)) |
