ws-cleanup-types: archive, audio, data, font, image, layered, music, playlist, subtitle, vector, video: annotations, casts, one value per re-assignment where the solver loses the type

This commit is contained in:
4DBug committed 2026-10-31 11:00:25 -05:00
1 parent dc98aec2ec
commit f459b2dcdf
44 files changed
+172 -119

No files matched your search

+5 -5
View File
@@ -214,7 +214,7 @@ function Decode.decode(s: string, opts: Options?): (any, any, number?)
-- a (dotted) key: { parts }, next | nil
local function key(i: number): ({ string }?, number)
local keys = {}
local keys: { string } = {}
while true do
i = ws(i)
local c = byte(s, i)
@@ -240,7 +240,7 @@ function Decode.decode(s: string, opts: Options?): (any, any, number?)
if k == nil then
return nil, 0
end
table.insert(keys, k)
table.insert(keys, k :: string)
i = ws(i)
if byte(s, i) == 46 then
i += 1
@@ -313,7 +313,7 @@ function Decode.decode(s: string, opts: Options?): (any, any, number?)
end
return if sign == "-" then -v else v, nexti
end
local text = sign .. digits
local text: string = (sign :: string) .. digits
local frac, r2 = match(rest :: string, "^%.([%d_]*)(.*)$")
if frac then
if not digitsOk(frac, "%d") then
@@ -324,10 +324,10 @@ function Decode.decode(s: string, opts: Options?): (any, any, number?)
end
if rest ~= "" then
local es, ed = match(rest :: string, "^[eE]([%+%-]?)([%d_]*)$")
if not es or not digitsOk(ed, "%d") then
if not es or not digitsOk(ed :: string, "%d") then
return fail("bad float", i), 0
end
text ..= "e" .. es .. gsub(ed, "_", "")
text ..= "e" .. es .. gsub(ed :: string, "_", "")
end
local v = tonumber(text)
if v == nil then