Модуль:Песочница/Pok/2: различия между версиями
Pok (обсуждение | вклад) Новая страница: «local p = {} local function split(s, sep) if s == nil then return {} end local parts = {} sep = sep or "%." for part in string.gmatch(s, "([^" .. sep .. "]+)") do table.insert(parts, part) end return parts end local function parse_indexed_part(part) local key, idx = string.match(part, "^(.-)%[(%d+)%]$") if key then return key, tonumber(idx) end local num = tonumber(part) if num then return nil, num end return part, nil end local functio...» |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 176: | Строка 176: | ||
local parts = {} | local parts = {} | ||
for k, v in pairs(flat) do | for k, v in pairs(flat) do | ||
table.insert(parts, | table.insert(parts, tostring(k) .. "=" .. tostring(v)) | ||
end | end | ||
return table.concat(parts, "|") | return table.concat(parts, "|") | ||