Content deleted Content added
←Created page with 'p = {} local function test( ... ) return a end function p.func(frame) _args = { a = "apple", b = "boy", } return test(_args) end return p' |
demo per request at WT:LUA |
||
(18 intermediate revisions by one other user not shown) | |||
Line 1:
local getArgs = require('Module:Arguments').getArgs
p = {}▼
local function
a = a or ''
return a▼
local refPattern = '\127UNIQ%x+%-ref%-%x+%-QINU\127'
local p, _ = string.find( a, refPattern )
local contentPart, refPart
if p then
contentPart = string.sub( a, 1, p - 1 )
refPart = string.sub( a, p )
else
contentPart = a
refPart = ''
end
return contentPart, refPart
end
▲local p = {}
local args = getArgs(frame)
end
function p._main(args)
-- Main module code goes here.
local ret
local pt1, pt2 = ref( args[1] )
ret = "<i>" .. pt1 .. "</i> hello" .. pt2
▲function p.func(frame)
▲ return test(_args)
end
|