More actions
add debugging code |
No edit summary |
||
Line 18: | Line 18: | ||
} | } | ||
local function exists(frame, page_name) | |||
return frame:callParserFunction("PAGEID", page_name) | |||
end | |||
local function create(frame, primary_text, link, css_name, secondary_text) | |||
return string.format([[<span class="lua-type" data-name="%s">]], css_name) | |||
end | |||
function exports.run(frame) | function exports.run(frame) | ||
local sb = "" | local sb = "" | ||
local input_args = frame:getParent().args | |||
local type_name = input_args.name or input_args[1] | |||
local compatibility_mode = {["?"]=true,["[]"]=true, ["[]?"]=true} | |||
if input_args[2] and compatibility_mode[input_args[2]] then | |||
end | end | ||
return | |||
local does_it_exist = exists(frame, "Main Page") | |||
return type(does_it_exist) .. " -> " .. tostring(does_it_exist) | |||
end | end | ||
return exports | return exports |
Revision as of 18:41, 28 September 2024
Documentation for this module may be created at Module:Type/doc
local exports = {}
local BUILTINS = {
["nil"] = true,
["number"] = true,
["integer"] = true,
["boolean"] = true,
["string"] = true,
["true"] = true,
["false"] = true,
["function"] = true,
["table"] = true,
}
local NOT_PLURAL = {
["Matrixs"] = true,
}
local ALIASES = {
}
local function exists(frame, page_name)
return frame:callParserFunction("PAGEID", page_name)
end
local function create(frame, primary_text, link, css_name, secondary_text)
return string.format([[<span class="lua-type" data-name="%s">]], css_name)
end
function exports.run(frame)
local sb = ""
local input_args = frame:getParent().args
local type_name = input_args.name or input_args[1]
local compatibility_mode = {["?"]=true,["[]"]=true, ["[]?"]=true}
if input_args[2] and compatibility_mode[input_args[2]] then
end
local does_it_exist = exists(frame, "Main Page")
return type(does_it_exist) .. " -> " .. tostring(does_it_exist)
end
return exports