-- 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={}localfunctionisnotempty(s)returnsands:match('^%s*(.-)%s*$')~=''endfunctionp.check(frame)localargs=frame.argslocalpargs=frame:getParent().argslocalignoreblank=isnotempty(frame.args['ignoreblank'])localcheckpos=isnotempty(frame.args['checkpositional'])localknownargs={}localunknown='Found _VALUE_, 'localres={}localcomments={}localcommentstr=''-- 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(type(k)=='string'andknownargs[k]==nil)thenif((notignoreblank)or(ignoreblankandisnotempty(v)))thenk=mw.ustring.gsub(k,'[^%w\-_ ]','?')localr=mw.ustring.gsub(unknown,'_VALUE_',k)table.insert(res,r)table.insert(comments,'"'..k..'"')endelseif(checkposandtype(k)=='number'andknownargs[tostring(k)]==nil)thenif((notignoreblank)or(ignoreblankandisnotempty(v)))thenlocalr=mw.ustring.gsub(unknown,'_VALUE_',k)table.insert(res,r)table.insert(comments,'"'..k..'"')endendendif(#comments>0)thencommentstr='<!-- Module:Check for unknown parameters results: '..table.concat(comments,', ')..'-->'endreturntable.concat(res)..commentstrendreturnp