From 8afab37c90416c5a6a6853df2e6976f26599f5c3 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 24 Sep 2017 20:20:43 -0700 Subject: Recompiled. --- utils.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'utils.lua') diff --git a/utils.lua b/utils.lua index e058645..84a0b54 100644 --- a/utils.lua +++ b/utils.lua @@ -10,6 +10,15 @@ utils = { end return true end, + size = function(t) + do + local n = 0 + for _ in pairs(t) do + n = n + 1 + end + return n + end + end, repr = function(x) local _exp_0 = type(x) if 'table' == _exp_0 then @@ -39,7 +48,9 @@ utils = { end)(), ", ")) .. "}" end elseif 'string' == _exp_0 then - if not x:find([["]]) and not x:find("\n") and not x:find("\\") then + if x == "\n" then + return "'\\n'" + elseif not x:find([["]]) and not x:find("\n") and not x:find("\\") then return "\"" .. x .. "\"" elseif not x:find([[']]) and not x:find("\n") and not x:find("\\") then return "\'" .. x .. "\'" -- cgit v1.2.3