Module:Sandbox/Frietjes/argcheck: Difference between revisions

Content deleted Content added
debug
No edit summary
Line 168:
local possibly_ignored = {}
local unknown = {}
local iargs = {}
local res = {}
Line 210 ⟶ 211:
if k:find('^team%d%d*$') then
teams[v] = 1
targsiargs[k] = ''1
if targs['name_' .. v] then
-- Great!
targsiargs['name_' .. v] = ''1
else
table.insert(missing_teams, v)
end
if targs['note_' .. v] then
targsiargs['note_' .. v] = ''1
end
if targs['hth_' .. v] then
Line 232 ⟶ 233:
if multiref > 0 then
for j, hth_loc in ipairs(hth_local_table) do
targsiargs['hth_' .. hth_loc] = ''1
end
elseif targs['hth_' .. targs['hth_' .. v]] then
targsiargs['hth_' .. targs['hth_' .. v]] = ''1
end
targsiargs['hth_' .. v] = ''1
end
elseif k:find('^result%d%d*$') or k:find('^.*_result%d%d*$') then
local pre = mw.ustring.gsub(k, '^(.*)result%d%d*$', '%1')
results[v] = 1
targsiargs[k] = ''1
if targs[pre .. 'col_' .. v] or targs[pre .. 'text_' .. v] or targs[pre .. 'note_res_' .. v] then
-- Great!
if targs[pre .. 'col_' .. v] then
targsiargs[pre .. 'col_' .. v] = ''1
end
if targs[pre .. 'text_' .. v] then
targsiargs[pre .. 'text_' .. v] = ''1
end
if targs[pre .. 'note_res_' .. v] then
Line 263 ⟶ 264:
if multiref > 0 then
for j, note_res_loc in ipairs(note_res_local_table) do
targsiargs[pre .. 'note_res_' .. note_res_loc] = ''1
end
elseif targs[pre .. 'note_res_' .. targs[pre .. 'note_res_' .. v]] then
targsiargs[pre .. 'note_res_' .. targs[pre .. 'note_res_' .. v]] = ''1
end
targsiargs[pre .. 'note_res_' .. v] = ''1
end
if targs[pre .. 'res_col_header'] then
targsiargs[pre .. 'res_col_header'] = ''1
end
else
Line 278 ⟶ 279:
elseif k:find('^match[%d]*_.*_.*_note$') then
local m = mw.ustring.gsub(k, '^(match[%d]*_.*_.*)_note$', '%1')
targsiargs[k] = ''1
if targs[m] then
if targs['note_' .. v] then
targsiargs['note_' .. v] = ''1
end
-- Great!