Content deleted Content added
dots |
test |
||
(4 intermediate revisions by the same user not shown) | |||
Line 58:
end
function error(
end
Line 71 ⟶ 70:
end
function p.prefix(frame)
local args = {}
for k,v in pairs(frame.args) do
if k ~= '_prefix' and k ~= '_template' then
table.insert(args, '| ' .. (frame.args['_prefix'] or '') .. k .. " = " .. v)
end
end
return table.concat(args, '\n')
end
return setmetatable(p, {__index =
function(_, key) -- this anonymous function called as function(TABLE, KEY)
return function (frame) return error (frame, key) end; -- which in turn returns a function that calls cite() with the KEY name
end
})
|