Movatterモバイル変換


[0]ホーム

URL:


Jump to content
Wikipedia
Bheka

Module:Check for unknown parameters

Mayelana Wikipedia

Documentation for this module may be created atModule:Check for unknown parameters/doc

-- This module may be used to compare the arguments passed to the parent-- with a list of arguments, returning a specified result if an argument is-- not on the listlocalp={}functionp.check(frame)localargs=frame.argslocalpargs=frame:getParent().argslocalknownargs={}localunknown='Found _VALUE_, 'localres={}-- create the list of known args, and the return stringfork,vinpairs(args)doiftype(k)=='number'thenv=mw.ustring.gsub(v,'^%s*(.-)%s*$','%1')knownargs[v]=1elseif(k=='unknown'andtype(v)=='string')thenunknown=vendendend-- loop over the parent args, and make sure they are on the listfork,vinpairs(pargs)doif(knownargs[k]==nilandtype(k)=='string')thenk=mw.ustring.gsub(k,'[^%w\-_ ]','?')localr=mw.ustring.gsub(unknown,'_VALUE_',k)table.insert(res,r)endendreturntable.concat(res)endreturnp
"https://zu.wikipedia.org/w/index.php?title=Module:Check_for_unknown_parameters&oldid=37561" تان ورتل

[8]ページ先頭

©2009-2025 Movatter.jp