Module:User:Benwing2/test-params

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This is a private module sandbox of Benwing2, for their own experimentation. Items in this module may be added and removed at Benwing2's discretion; do not rely on this module's stability.


local export = {}

function export.test(frame)
	local params = {
		["g"] = {list = true},
		[1] = {list = "h"},
		["sort"] = {type = "boolean"},
		["clq"] = {type = "boolean"},
		["partclq"] = {type = "boolean", list = "clq", allow_holes = true, require_index = true},
		["cal"] = {alias_of = "clq", type = "boolean"},
		["partcal"] = {alias_of = "partclq", list = "cal", type = "boolean", allow_holes = true, require_index = true},
		["calq"] = {alias_of = "clq", type = "boolean"},
		["partcalq"] = {alias_of = "partclq", list = "calq", type = "boolean"},
		["calque"] = {alias_of = "clq"},
		["partcalque"] = {alias_of = "partclq", list = true, allow_holes = true, require_index = true},
		["convert_plus_1"] = {type = "number", convert = function(val) return val + 1 end},
		["convert_concat_1"] = {convert = function(val) return val .. 1 end},
		["convert_error"] = {type = "number", convert = function(val, parse_err) parse_err("error in convert_error: " .. val) end},
		["bool_sublist"] = {type = "boolean", sublist = true},
		["qual_sublist"] = {type = "qualifier", sublist = true},
		["ref_sublist"] = {type = "references", sublist = "%$%$"},
		["comma_no_whitespace_sublist"] = {type = "references", sublist = require("Module:User:Benwing2/parameters").split_on_comma_without_whitespace},
		["num_slash_sublist"] = {type = "number", sublist = "/"},
		["convert_error_sublist"] = {type = "number", convert = function(val, parse_err) parse_err("error in convert_error_sublist: " .. val) end, sublist = "/"},
		["convert_plus_1_slash_sublist"] = {type = "number", convert = function(val) return val + 1 end, sublist = "/"},
		["convert_plus_1_slash_sublist_set"] = {type = "number", convert = function(val) return val + 1 end, sublist = "/", set = {1, 2, 3}},
	}
	local args = require("Module:User:Benwing2/parameters").process(frame:getParent().args, params)
	return mw.dumpObject(args)
end

return export