Skip to content

Commit 65bb41f

Browse files
committed
chore(utils) With this 100% of the code conventions should be correct. Tests passing OK. There souldn't be need to touch this ever again.
1 parent 9120628 commit 65bb41f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lua/compiler/utils.lua

+8-8
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,24 @@ function M.find_files_to_compile(entry_point, pattern)
4646
end
4747

4848
-- Parse the config file and extract variables
49-
---@param string
49+
---@param file_path string
5050
---@return table config A table like { {entry_point, ouptput, ..} .. }
51-
function M.parse_config_file(filePath)
52-
local file = assert(io.open(filePath, "r")) -- Open the file in read mode
51+
function M.parse_config_file(file_path)
52+
local file = assert(io.open(file_path, "r")) -- Open the file in read mode
5353
local config = {} -- Initialize an empty Lua table to store the variables
54-
local currentEntry = nil -- Variable to track the current entry being processed
54+
local current_entry = nil -- Variable to track the current entry being processed
5555

5656
for line in file:lines() do
5757
if not (line:match("^%s*#") or line:match("^%s*$")) then -- ignore comments and empty lines
5858
local entry = line:match("%[([^%]]+)%]") -- Check if the line represents a new entry
5959
if entry then
60-
currentEntry = entry -- Update the current entry being processed
61-
config[currentEntry] = {} -- Initialize a sub-table for the current entry
60+
current_entry = entry -- Update the current entry being processed
61+
config[current_entry] = {} -- Initialize a sub-table for the current entry
6262
else
6363
local key, value = line:match("([^=]+)%s-=%s-(.+)") -- Extract key-value pairs
64-
if key and value and currentEntry then
64+
if key and value and current_entry then
6565
value = value:gsub("^%s*[\"'](.+)[\"']%s*$", "%1") -- Remove surrounding quotes if present
66-
config[currentEntry][vim.trim(key)] = vim.trim(value) -- Store the variable in the table
66+
config[current_entry][vim.trim(key)] = vim.trim(value) -- Store the variable in the table
6767
end
6868
end
6969
end

0 commit comments

Comments
 (0)