mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 14:25:02 +00:00
19 lines
560 B
Lua
19 lines
560 B
Lua
--- Extracts and validates Lua file requires
|
|
---@param filepath string Path to the Lua file
|
|
---@param content string File content
|
|
---@return string[] requires List of required modules
|
|
---@return string[] errors List of errors
|
|
local function validate_lua_requires(filepath, content)
|
|
local errors = {}
|
|
local requires = {}
|
|
|
|
-- Extract all require statements
|
|
for req in string.gmatch(content, 'require%s*%(%s*["\']([^"\']+)["\']%s*%)') do
|
|
table.insert(requires, req)
|
|
end
|
|
|
|
return requires, errors
|
|
end
|
|
|
|
return validate_lua_requires
|