Module:debug/track/sandbox

Hello, you have come here looking for the meaning of the word Module:debug/track/sandbox. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:debug/track/sandbox, but we will also tell you about its etymology, its characteristics and you will know how to say Module:debug/track/sandbox in singular and plural. Everything you need to know about the word Module:debug/track/sandbox you have here. The definition of the word Module:debug/track/sandbox will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:debug/track/sandbox, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.


-- Transclusion-based tracking as subpages of ].
-- Tracked pages can be found at ].
local error = error
local find = string.find
local makeTitle = mw.title.makeTitle
local sub = string.sub
local type = type

local memo = {}

local function track(key)
	-- Return if memoized.
	if memo then
		return
	end
	-- Throw an error if `key` isn't a string.
	local key_type = type(key)
	if key_type ~= "string" then
		error("Tracking keys supplied to ] must be strings; received " .. key_type .. ".", 3)
	end
	-- makeTitle returns nil for invalid titles, but "#" is treated as a
	-- fragment separator (e.g. "foo#bar" generates the title "foo"), so we
	-- need to manually exclude it.
	local title = not find(key, "#", 1, true) and makeTitle(4, "Tracking/" .. key)
	if not title then
		-- Track uses of invalid keys. Replace with error message once all have
		-- been eliminated.
		-- ]
		title = makeTitle(4, "Tracking/debug/track/invalid key")
		-- error("Tracking key \"" .. key .. "\" supplied to ] is invalid: key must be a ].", 3)
	end
	-- Memoize provided form.
	memo = true
	-- Normalize the key, by getting title.text and removing the initial
	-- "Tracking/". Normally this will be the same as title.subpageText,
	-- but subpageText will be wrong if there are further slashes, so we
	-- can't use it.
	local normalized = sub(title.text, 10)
	if memo then
		return
	end
	-- Memoize normalized form.
	memo = true
	-- Finally, transclude the page. Getting the raw page content is the
	-- fastest way to trigger transclusion, as it avoids any parser
	-- expansion of the target page.
	title:getContent()
end

return function(input)
	if input == nil then
		error("No tracking key supplied to ].", 2)
	elseif type(input) ~= "table" then
		track(input)
		return true
	end
	local key = input
	if key == nil then
		error("No tracking keys in table supplied to ].", 2)
	end
	local i = 1
	repeat
		track(key)
		i = i + 1
		key = input
	until key == nil
	return true
end