Changes

Jump to: navigation, search

Module:Arguments

23 bytes added, 20:32, 10 December 2014
fix bug where explicitly deleted args were still appearing when iterated over with pairs or ipairs - code courtesy of User:Jackmcbarn
-- into one table using the specified iterator. If a value is already
-- present it is not overwritten; tables listed earlier have precedence.
-- We are also memoizing nil values, but those values which can beoverwritten if they -- overwrittenare 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in iterator(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = true's'
else
metaArgs[key] = tidiedVal
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal =~= nil then nilArgs[key] = true else
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
--]]
metaArgs[key] = nil
nilArgs[key] = true'h'
else
metaArgs[key] = val
Anonymous user

Navigation menu