This commit is contained in:
luk3yx 2019-07-14 14:37:55 +12:00
parent 36143d935d
commit 6745d01e32
1 changed files with 8 additions and 1 deletions

View File

@ -8,7 +8,7 @@ return function(code)
assert(type(code) == 'string')
local res, last, ws1, ws2, escape = '', false, '\n', '\n', false
local sp = {['"'] = true, ["'"] = true}
local sp = {['"'] = true, ["'"] = true, ['['] = true}
for i = 1, #code do
local char = code:sub(i, i)
@ -54,6 +54,13 @@ return function(code)
elseif last == '"' or last == "'" then
if char == last then last = false end
res = res .. char
elseif last == '[' then
if char == last then
last = last .. char
else
last = false
end
res = res .. char
elseif last == '-' then
if char == '-' then
last, ws1 = '--', ws2