Module:Video game reviews/sandbox: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
use new data format
Jackmcbarn (talk | contribs)
apply same simplifications to aggregator logic, and remove now-unused Split function
Line 22:
local HtmlBuilder = require('Module:HtmlBuilder')
local categoryHandler = require('Module:Category handler').main
 
local function Split(str, delim)
local retval, endpos = {}, 1
for elem, pos in str:gmatch('(.-)' .. delim .. '()') do
table.insert(retval, elem)
endpos = pos
end
table.insert(retval, str:sub(endpos))
return retval
end
 
local function getActiveSystems(args)
Line 491 ⟶ 481:
function p._reviewbox(args)
local halfkeysrev, halfkeysagg = {}, {}
local flags = {}
local sortedArgKeys = {}
Line 527 ⟶ 516:
end
 
local flags = {}
local j = 1
-- creates a table of all unique aggregators.
if platforms ~= 0 then
local seenAggregators = {}
for i=1,#sortedArgKeys do
iffor string.find(tostring_,argKey in ipairs(sortedArgKeys[i]), '_') ~= nil thendo
local halfargssplitPos = SplitargKey:find(tostring(sortedArgKeys[i]),'_')
if splitPos then
for k=1, #aggregator do
local halfarg = argKey:sub(1, splitPos - 1)
if aggregator[k][2] == halfargs[1] then
if data.aggregators[halfarg] and not flagsseenAggregators[halfargs[1]halfarg] then
flagsseenAggregators[halfargs[1]halfarg] = true
table.insert(halfkeysagg[j], = halfargs[1]halfarg)
j = j + 1
end
end
end
end
end
else
for i=1_,#argKey in ipairs(sortedArgKeys) do
if string.not argKey:find(tostring(sortedArgKeys[i]), '_') ==and nildata.aggregators[argKey] then
table.insert(retvalhalfkeysagg, elemargKey)
for k=1, #aggregator do
if aggregator[k][2] == sortedArgKeys[i] then
halfkeysagg[j] = sortedArgKeys[i]
j = j + 1
end
end
end
end