Trans.nvim/lua/Trans/init.lua

27 lines
573 B
Lua
Raw Normal View History

local function metatable(folder_name)
return setmetatable({}, {
__index = function(tbl, key)
local status, result = pcall(require, ('Trans.%s.%s'):format(folder_name, key))
if not status then
error('fail to load: ' .. key .. '\n' .. result)
end
tbl[key] = result
return result
end
})
end
local M = metatable('core')
M.metatable = metatable
M.style = metatable("style")
M.wrapper = metatable("wrapper")
M.frontend = metatable("frontend")
M.cache = {}
2022-12-17 16:07:27 +08:00
return M