about summary refs log tree commit diff stats
path: root/lua/chupacabra/repl.lua
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2024-06-09 20:54:53 -0400
committerelioat <elioat@tilde.institute>2024-06-09 20:54:53 -0400
commit3ff223f2a297a7300fede33dbe69da63f08e0c84 (patch)
tree0576d764fe9ab6e22b735e261237502bd1cf7f31 /lua/chupacabra/repl.lua
parent252f3076873868dee5cec2b4b571b47673c1cf06 (diff)
downloadtour-3ff223f2a297a7300fede33dbe69da63f08e0c84.tar.gz
*
Diffstat (limited to 'lua/chupacabra/repl.lua')
-rw-r--r--lua/chupacabra/repl.lua13
1 files changed, 1 insertions, 12 deletions
diff --git a/lua/chupacabra/repl.lua b/lua/chupacabra/repl.lua
index 6abbf46..ba489e2 100644
--- a/lua/chupacabra/repl.lua
+++ b/lua/chupacabra/repl.lua
@@ -1,17 +1,6 @@
 local chupacabra = require("chupacabra")
 
 -- not a great, but a passable repl
-local function table_to_string(t)
-    local str = "["
-    for i, v in ipairs(t) do
-        if i > 1 then
-            str = str .. " "
-        end
-        str = str .. tostring(v)
-    end
-    str = str .. "]"
-    return str
-end
 
 local stack = {}
 
@@ -24,7 +13,7 @@ local function scratch_out()
     for i, entry in ipairs(stack) do
         print("   input: " .. entry.input)
         if type(entry.output) == "table" then
-            print("  output: " .. table_to_string(entry.output))
+            print("  output: " .. chupacabra.table_to_string(entry.output))
         else
             print("  output: " .. tostring(entry.output))
         end