Module:Sandbox/MonkeysHK

p = {} local libraryUtil = require('Module:LibraryUtil') local checkType = libraryUtil.checkType

function p.mergeArgsSyntax(args, start, pattern) -- Check if list format is being used local pattern, start = pattern or '%s*%*+%s*', tonumber(start) or 1 local function _tostring(v) if type(v) == "table" then return table.concat(v) elseif type(v) == "boolean" or v == nil or type(v) == "number" or type(v) == "function" then return tostring(v) else return v   	end end --errors checkType(1, args, 'table') checkType(2, start, 'number', true) checkType(3, pattern, 'string', true) args[start] = _tostring(args[start]) if args[start]:match(pattern) then local list = mw.text.split(args[start], pattern) list[1] = _tostring(list[1]) if not list[1] or list[1] == '' then table.remove(list,1) end return list elseif args[start] and not args[start]:match("%*") and not args[start+1] then return {args[start]} end --else local list, i = {}, start while args[i] do       list[#list+1] = _tostring(args[i]) i = i + 1 end return list end

function p.locationList(frame) local args = frame.args local text = p.mergeArgsSyntax(args, 1) ret = "" for i, v in pairs(text) do ret = ret .. tostring(v) end return ret end

return p