diff options
-rw-r--r-- | lua/chupacabra/repl.lua | 6 | ||||
-rw-r--r-- | lua/chupacabra/scratch.lua | 6 | ||||
-rw-r--r-- | lua/chupacabra/test_chupacabra.lua | 7 |
3 files changed, 9 insertions, 10 deletions
diff --git a/lua/chupacabra/repl.lua b/lua/chupacabra/repl.lua index 55e10a4..6abbf46 100644 --- a/lua/chupacabra/repl.lua +++ b/lua/chupacabra/repl.lua @@ -2,14 +2,14 @@ local chupacabra = require("chupacabra") -- not a great, but a passable repl local function table_to_string(t) - local str = "{" + local str = "[" for i, v in ipairs(t) do if i > 1 then - str = str .. ", " + str = str .. " " end str = str .. tostring(v) end - str = str .. "}" + str = str .. "]" return str end diff --git a/lua/chupacabra/scratch.lua b/lua/chupacabra/scratch.lua index c5e0ee2..9dbe724 100644 --- a/lua/chupacabra/scratch.lua +++ b/lua/chupacabra/scratch.lua @@ -1,14 +1,14 @@ local chupacabra = require("chupacabra") local function table_to_string(t) - local str = "{" + local str = "[" for i, v in ipairs(t) do if i > 1 then - str = str .. ", " + str = str .. " " end str = str .. tostring(v) end - str = str .. "}" + str = str .. "]" return str end diff --git a/lua/chupacabra/test_chupacabra.lua b/lua/chupacabra/test_chupacabra.lua index e2f54b1..0a06124 100644 --- a/lua/chupacabra/test_chupacabra.lua +++ b/lua/chupacabra/test_chupacabra.lua @@ -1,15 +1,14 @@ local chupacabra = require("chupacabra") --- convert a table to a string local function table_to_string(t) - local str = "{" + local str = "[" for i, v in ipairs(t) do if i > 1 then - str = str .. ", " + str = str .. " " end str = str .. tostring(v) end - str = str .. "}" + str = str .. "]" return str end |