Module:Convert: Difference between revisions

fix sigfig warning: if not empty, warning needs value not name; fix so does not execute following code once sigfig is handled
(if bad sigfig then warning only rather than fatal error)
(fix sigfig warning: if not empty, warning needs value not name; fix so does not execute following code once sigfig is handled)
Line 1,383:
else
local number, is_integer = get_number(loc_value)
if not number or notand is_integer orand number <=> 0 then
add_warning(parms, 'cvt_bad_sigfig', loc_name)
-- return false, { 'cvt_bad_sigfig', loc_value }
else
en_value = number
else
add_warning(parms, 'cvt_bad_sigfig', loc_nameloc_value)
end
end
else
en_value = en_option_value[en_name][loc_value]
end if en_value == nil then
if en_valueloc_value == nil'' then
if loc_value == add_warning(parms, 'cvt_empty_option', thenloc_name)
add_warning(parms, 'cvt_empty_option', loc_name)else
-- loc_value can no longer be nil here (at one time, that could occur
else
-- loc_value can no longer-- bewith nilaliases herelike (at|sing=off|adj=on), onebut time,am thatretaining couldsafety occurcheck.
-- with aliases like |sing=off|adjlocal text =on), butloc_value amand retaining(loc_name safety.. '=' check.. loc_value) or loc_name
local text = loc_value and add_warning(loc_name ..parms, '=cvt_unknown_option', .. loc_valuetext) or loc_name
add_warning(parms, 'cvt_unknown_option', text)end
endelseif en_value == '' then
elseif en_value == ''nil then -- an ignored option like adj=off
elseif type(en_value) == nil'string' and --en_value:sub(1, an4) ignored== option'opt_' like adj=offthen
elseif type(en_value) == 'string' and en_value:sub(1 for _, 4)v ==in ipairs(split(en_value, 'opt_,')) thendo
for _, v in ipairs(split(en_value, ',')) do parms[v] = true
parms[v] = trueend
else en_value = nil
end
en_value = nil
end
parms[en_name] = en_value
Anonymous user