Initial commit

This commit is contained in:
2025-03-06 01:39:36 +07:00
commit 9d00ee4e47
35 changed files with 587 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
ModTable = {}
local modLoggers = {}
local loadedModules = {}
local DS = '/'
function ModTable:getRequire()
return function(fileName)
local modName = self.name
local modPath = self.path
local fullName = modName .. '..' .. fileName
local module = loadedModules[fullName]
if module ~= nil then
return module
end
local result = dofile(modPath .. DS .. 'src' .. DS .. fileName:gsub('%.', DS) .. '.lua')
if result ~= nil then
loadedModules[fullName] = result
else
loadedModules[fullName] = true
end
return loadedModules[fullName]
end
end
function ModTable:new(name, path)
local modTable = {
name = name,
path = path,
}
setmetatable(modTable, self)
self.__index = self
return modTable
end

View File

@@ -0,0 +1 @@
name = api__mod_table