Module:pollasena-roots: Difference between revisions
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
local m_families = require("Module:families") | local m_families = require("Module:families") | ||
local m_languages = require("Module:languages") | local m_languages = require("Module:languages") | ||
local m_param = require("Module:parameters") | |||
local m_param_utils = require("Module:parameter utilities") | |||
local gsub = mw.ustring.gsub | local gsub = mw.ustring.gsub | ||
| Line 109: | Line 111: | ||
return table.concat(links) .. ncategories(categories) | return table.concat(links) .. ncategories(categories) | ||
end | |||
local function parse_etym_args(parent_args, base_params) | |||
local param_mods = m_param_utils.construct_param_mods({{group = {"link", "q", "l"}}}) | |||
local terms, args = m_param_utils.parse_term_with_inline_modifiers_and_separate_params({ | |||
params = base_params, | |||
param_mods = param_mods, | |||
raw_args = parent_args, | |||
termarg = 1, | |||
lang = function(args) | |||
return args[sourcearg][#args[sourcearg]] | |||
end, | |||
sc = "sc", | |||
}) | |||
-- If term param 3= is empty, there will be no terms in terms.terms. To facilitate further code and for | |||
-- compatibility,, insert one. It will display as <small>[Term?]</small>. | |||
if not terms.terms[1] then | |||
terms.terms[1] = { | |||
lang = args[sourcearg][#args[sourcearg]], | |||
sc = args.sc, | |||
} | |||
end | |||
return terms.terms, args | |||
end | |||
local function parse_args(parent_args, dest_code, ancestor_codes) | |||
local params = { | |||
[1] = { | |||
required = true, | |||
list = true, | |||
allow_holes = true, | |||
}, | |||
["nocat"] = {type = "boolean"}, | |||
} | |||
for code, lang_options in ipairs() do | |||
end | |||
return parse_etym_args(parent_args, params) | |||
end | end | ||
function export.qsc(frame) | function export.qsc(frame) | ||
local | local ancestor_codes = { | ||
["sekh"] = {}, | |||
["wasc"] = {optional = true} | |||
} | |||
local parent_args = frame:getParent().args | local parent_args = frame:getParent().args | ||
local terms, args = | local terms, args = parse_args(parent_args, "qsc", ancestor_codes) | ||
end | end | ||
return export | return export | ||