diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2017-09-24 20:20:43 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2017-09-24 20:20:43 -0700 |
| commit | 8afab37c90416c5a6a6853df2e6976f26599f5c3 (patch) | |
| tree | 5eb2e8bd26138ea55cbbdd4b458c01c196a7a74d /utils.lua | |
| parent | af3274ca9237a08093009e87955e30ab5f473f12 (diff) | |
Recompiled.
Diffstat (limited to 'utils.lua')
| -rw-r--r-- | utils.lua | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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 .. "\'" |
