模块:Utils:修订间差异

无编辑摘要
Lz讨论 | 贡献
无编辑摘要
第2行: 第2行:


function p.foreach(frame)
function p.foreach(frame)
     local template = frame.args[1]
     local template = frame.args[1]:gsub('\n$', '')
     template = template:gsub('\\n', '\n')
     template = template:gsub('\\n', '\n')
     template = template:gsub('%(%(!%)%)', '|')
     template = template:gsub('%(%(!%)%)', '|')
    template = template:gsub('%(%(=%)%)', '=')
     local ret = ''
     local ret = ''
     for i, arg in ipairs(frame.args) do
     for i, arg in ipairs(frame.args) do
第18行: 第17行:
function p.d()
function p.d()
     local frame = {
     local frame = {
         args = { '((!))hello (((1)))\n', 'x', 'y', 'z' }
         args = { '((!))hello (((1)))\n', 'x\n', 'y\n', 'z' }
     }
     }
     local r = p.foreach(frame)
     local r = p.foreach(frame)