[Lua] Avoid missing field warning by reversing the order of the check
This commit is contained in:
parent
9e79a627c3
commit
faaeaadaa1
1 changed files with 12 additions and 12 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue