2023-03-11 00:24:48 +08:00
|
|
|
return setmetatable({}, {
|
|
|
|
__index = function(t, k)
|
|
|
|
local res, engine = pcall(require, [[Trans.backend.]] .. k)
|
2023-03-12 09:56:31 +08:00
|
|
|
if not res then
|
|
|
|
error([[Fail to load backend: ]] .. k .. '\n ' .. engine)
|
|
|
|
end
|
2023-03-11 00:24:48 +08:00
|
|
|
t[k] = engine
|
|
|
|
return engine
|
|
|
|
end
|
|
|
|
})
|