[Lua] Avoid missing field warning by reversing the order of the check

This commit is contained in:
Celtic Minstrel 2024-02-08 09:57:53 -05:00 committed by Celtic Minstrel
parent 9e79a627c3
commit faaeaadaa1

View File

@ -188,10 +188,10 @@ wml.tag = setmetatable({}, create_tag_mt)
---@param cfg WML
---@return WMLTable
function wml.literal(cfg)
if type(cfg) == "userdata" then
return cfg.__literal
else
if type(cfg) == "table" then
return cfg or {}
else
return cfg.__literal
end
end
@ -201,10 +201,10 @@ end
---@param cfg WML
---@return WMLTable
function wml.parsed(cfg)
if type(cfg) == "userdata" then
return cfg.__parsed
else
if type(cfg) == "table" then
return cfg or {}
else
return cfg.__parsed
end
end
@ -214,10 +214,10 @@ end
---@param cfg WML
---@return WMLTable
function wml.shallow_literal(cfg)
if type(cfg) == "userdata" then
return cfg.__shallow_literal
else
if type(cfg) == "table" then
return cfg or {}
else
return cfg.__shallow_literal
end
end
@ -228,10 +228,10 @@ end
---@param cfg WML
---@return WMLTable
function wml.shallow_parsed(cfg)
if type(cfg) == "userdata" then
return cfg.__shallow_parsed
else
if type(cfg) == "table" then
return cfg or {}
else
return cfg.__shallow_parsed
end
end