"ഘടകം: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)
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)
else
local arg = args[formatStr.arg or "route"]
end
end
formatStr = formatStrInTable(formatStr)
if formatStr == '' then return '' end
local preprocessed = gsub(formatStr, prepattern, testArgs)
|