Module:descendants: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 191: Line 191:
local sorter = {}
local sorter = {}
local sorter_proto = {}
local sorter_proto = {}
local sorter_bor = {}
local sorter_bor_proto = {}
for key, _ in pairs(tab) do
for key, _ in pairs(tab) do
if mw.ustring.find(key, "%-pro$") then
if mw.ustring.find(key, "%-pro[0-9]*$") then
table.insert(sorter_proto, key)
if mw.ustring.find(key, "%>[^%>%_%:]+$") then
table.insert(sorter_bor_proto, key)
else
table.insert(sorter_proto, key)
end
else
else
table.insert(sorter, key)
if mw.ustring.find(key, "%>[^%>%_%:]+$") then
table.insert(sorter_bor, key)
else
table.insert(sorter, key)
end
end
end
end
end
table.sort(sorter)
table.sort(sorter)
table.sort(sorter_proto)
table.sort(sorter_proto)
for _, key in ipairs(sorter_proto) do
table.sort(sorter_bor)
table.insert(sorter, key)
table.sort(sorter_bor_proto)
end
for _, key in ipairs(sorter_bor) do table.insert(sorter, key) end
for _, key in ipairs(sorter_proto) do table.insert(sorter, key) end
for _, key in ipairs(sorter_bor_proto) do table.insert(sorter, key) end
for _, key in ipairs(sorter) do
for _, key in ipairs(sorter) do