모듈:Anchor

모니터링 (토론 | 기여)님의 2018년 5월 16일 (수) 14:07 판 (판 1개를 가져왔습니다)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

-- 에 쓰이는 모듈입니다.

local getArgs = require('모듈:Arguments').getArgs local tableTools = require('모듈:TableTools')

local p = {}

function p.main(frame) -- Get the positional arguments from #invoke, remove any nil values, -- and pass them to p._main. local args = getArgs(frame) local argArray = tableTools.compressSparseArray(args) return p._main(unpack(argArray)) end

function p._main(...) -- Generate the list of anchors. local anchors = {...} local ret = {} for _, anchor in ipairs(anchors) do ret[#ret + 1] = '' end return table.concat(ret) end

return p