add cache and rename some files

This commit is contained in:
2026-01-15 15:41:19 +01:00
parent 7879f15726
commit b64815d9ab
4753 changed files with 931902 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
local function mergeKey(key, k)
if not key then
return k
end
if k:sub(1, 1):match '%w' then
return key .. '.' .. k
else
return key .. k
end
end
local function proxy(results, key)
return setmetatable({}, {
__index = function (_, k)
return proxy(results, mergeKey(key, k))
end,
__newindex = function (_, k, v)
results[mergeKey(key, k)] = v
end
})
end
return function (text, path, results)
results = results or {}
assert(load(text, '@' .. path, "t", proxy(results)))()
return results
end