feat: added support for plugin packages by lazy, rockspec and packspec

This commit is contained in:
Folke Lemaitre 2024-06-18 21:54:54 +02:00
commit 3be55a4615
11 changed files with 281 additions and 171 deletions

View file

@ -241,22 +241,21 @@ function M._dump(value, result)
table.insert(result, value._raw)
elseif t == "table" then
table.insert(result, "{")
local i = 1
for _, v in ipairs(value) do
M._dump(v, result)
table.insert(result, ",")
end
---@diagnostic disable-next-line: no-unknown
for k, v in pairs(value) do
if k == i then
elseif type(k) == "string" then
if type(k) == "string" then
if k:match("^[a-zA-Z]+$") then
table.insert(result, ("%s="):format(k))
else
table.insert(result, ("[%q]="):format(k))
end
else
table.insert(result, k .. "=")
M._dump(v, result)
table.insert(result, ",")
end
M._dump(v, result)
table.insert(result, ",")
i = i + 1
end
table.insert(result, "}")
else