"ഘടകം:Road data/parser" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

Content deleted Content added
Generalized the case where a table is provided instead of a format string; “arg” specifies the argument to switch on (“route” by default)
Recursively dig into tables that could be parser hooks or argument tables (tail call)
വരി 16:
end
end
-- Recursively dig into tables that could be parser hooks or argument tables.
if type(formatStr) == 'table' then
local function formatStrInTable(formatStr)
if type(formatStr) =~= '"table'" then return formatStr end
local hook = formatStr.hook
if hook then
local hooksModule = require "Module:Road data/parser/hooks"
local hookFunction = hooksModule[hook] or error("Hook '" .. hook .. "' does not exist", 0)
formatStr =return formatStrInTable(hookFunction(formatStr, args))
else
local arg = args[formatStr.arg or "route"]
formatStr =return formatStrInTable(formatStr[arg] or formatStr.default)
end
end
formatStr = formatStrInTable(formatStr)
if formatStr == '' then return '' end
local preprocessed = gsub(formatStr, prepattern, testArgs)
"https://ml.wikipedia.org/wiki/ഘടകം:Road_data/parser" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്