lualoader: Correct test sense, comments, and add some more comments
This commit is contained in:
parent
2bb86aefec
commit
fb7275bedb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=330088
@ -333,6 +333,9 @@ function config.loadmod(mod, silent)
|
|||||||
return status
|
return status
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Returns true if we processed the file successfully, false if we did not.
|
||||||
|
-- If 'silent' is true, being unable to read the file is not considered a
|
||||||
|
-- failure.
|
||||||
function config.processFile(name, silent)
|
function config.processFile(name, silent)
|
||||||
if silent == nil then
|
if silent == nil then
|
||||||
silent = false
|
silent = false
|
||||||
@ -340,15 +343,13 @@ function config.processFile(name, silent)
|
|||||||
|
|
||||||
local text = readFile(name, silent)
|
local text = readFile(name, silent)
|
||||||
if text == nil then
|
if text == nil then
|
||||||
return not silent
|
return silent
|
||||||
end
|
end
|
||||||
|
|
||||||
return config.parse(text)
|
return config.parse(text)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- silent runs will not return false if we fail to open the file
|
-- silent runs will not return false if we fail to open the file
|
||||||
-- check_and_halt, if it's set, will be executed on the full text of the config
|
|
||||||
-- file. If it returns false, we are to halt immediately.
|
|
||||||
function config.parse(text)
|
function config.parse(text)
|
||||||
local n = 1
|
local n = 1
|
||||||
local status = true
|
local status = true
|
||||||
|
Loading…
Reference in New Issue
Block a user