2023年政策修订增补工作正在进行中,欢迎参与!
Module:Sandbox/imbushuo/BooleanSwitch
跳转到导航
跳转到搜索
-- This module determines if a certain switch parameter
-- exists in template invocation parameters.
local p = {}
function p.boolMatch(frame)
local matchArg = frame.args[1]
if matchArg ~= nil then
-- So we will iterate every parameters in the upper level.
local parentPage = frame:getParent()
for _, param in pairs(parentPage.args) do
if param == matchArg then
return true
end
end
end
-- Otherwise
return false
end
return p