יחידה:ParamValidator: הבדלים בין גרסאות בדף

תוכן שנמחק תוכן שנוסף
מאין תקציר עריכה
duplicate only if both have values
שורה 200:
for p_name, value in pairs( t_args ) do
local tp_param, noval, numeric, table_name = td_params[p_name] or all_aliases[p_name], util.empty( value ), tonumber( p_name )
local hasval = not noval
if not tp_param then -- not in TD: this is called undeclared
שורה 206 ⟵ 207:
noval and numeric and 'empty-undeclared-numeric' or
noval and not numeric and 'empty-undeclared' or
not novalhasval and numeric and 'undeclared-numeric' or
'undeclared' -- tzvototi nishar.
else -- in td: test for deprecation and mistype. if deprecated, no further tests
table_name = tp_param.deprecated and not novalhasval and 'deprecated'
or tp_param.deprecated and noval and 'empty-deprecated'
or not compatible( tp_param.type, value ) and 'incompatible'
or already_seen[tp_param] and hasval and 'duplicate'
already_seen[tp_param] = truehasval
end
-- report it.