From fe62c5ef79cdfc470351e3a9994bc6b00f40bd76 Mon Sep 17 00:00:00 2001 From: mryouse Date: Tue, 24 May 2022 03:38:31 +0000 Subject: bugfix: wrap split's items in a Literal --- interpreter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'interpreter.py') 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)) -- cgit v1.2.3