Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions LIP.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ function LIP.load(fileName)
local data = {};
local section;
for line in file:lines() do
local tempSection = line:match('^%[([^%[%]]+)%]$');
local tempSection = line:match('^%[([^%[%]]+)%][\r]?$');
if(tempSection)then
section = tonumber(tempSection) and tonumber(tempSection) or tempSection;
data[section] = data[section] or {};
end
local param, value = line:match('^([%w|_]+)%s-=%s-(.+)$');
local param, value = line:match('^([%w|_]+)%s-=%s-(.+)[\r]?$');
if(param and value ~= nil)then
if(tonumber(value))then
value = tonumber(value);
Expand Down Expand Up @@ -77,4 +77,4 @@ function LIP.save(fileName, data)
file:close();
end

return LIP;
return LIP;