aboutsummaryrefslogtreecommitdiff
path: root/stand/lua/config.lua
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2018-02-25 03:30:24 +0000
committerKyle Evans <kevans@FreeBSD.org>2018-02-25 03:30:24 +0000
commite1a8835aa8a6872ea624480402125b6bbb95ec24 (patch)
tree07bee8e43ab3e98bbb19bcadbc36f919b943bf26 /stand/lua/config.lua
parent1c2529ab32bf3664dd3d137eb8944fbc8a0c6d53 (diff)
downloadsrc-e1a8835aa8a6872ea624480402125b6bbb95ec24.tar.gz
src-e1a8835aa8a6872ea624480402125b6bbb95ec24.zip
lualoader: Don't explicitly index tables without reason
These indices were assigned the same values as they would've been implicitly assigned anyways. While here, throw terminating commas after the last value of tables.
Notes
Notes: svn path=/head/; revision=329944
Diffstat (limited to 'stand/lua/config.lua')
-rw-r--r--stand/lua/config.lua49
1 files changed, 24 insertions, 25 deletions
diff --git a/stand/lua/config.lua b/stand/lua/config.lua
index aa59c70bf4c1..a190abd3edd3 100644
--- a/stand/lua/config.lua
+++ b/stand/lua/config.lua
@@ -33,95 +33,94 @@ local config = {}
local modules = {}
-local pattern_table
local carousel_choices = {}
-pattern_table = {
- [1] = {
+local pattern_table = {
+ {
str = "^%s*(#.*)",
- process = function(_, _) end
+ process = function(_, _) end,
},
-- module_load="value"
- [2] = {
+ {
str = "^%s*([%w_]+)_load%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
process = function(k, v)
if modules[k] == nil then
modules[k] = {}
end
modules[k].load = v:upper()
- end
+ end,
},
-- module_name="value"
- [3] = {
+ {
str = "^%s*([%w_]+)_name%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
process = function(k, v)
config.setKey(k, "name", v)
- end
+ end,
},
-- module_type="value"
- [4] = {
+ {
str = "^%s*([%w_]+)_type%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
process = function(k, v)
config.setKey(k, "type", v)
- end
+ end,
},
-- module_flags="value"
- [5] = {
+ {
str = "^%s*([%w_]+)_flags%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
process = function(k, v)
config.setKey(k, "flags", v)
- end
+ end,
},
-- module_before="value"
- [6] = {
+ {
str = "^%s*([%w_]+)_before%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
process = function(k, v)
config.setKey(k, "before", v)
- end
+ end,
},
-- module_after="value"
- [7] = {
+ {
str = "^%s*([%w_]+)_after%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
process = function(k, v)
config.setKey(k, "after", v)
- end
+ end,
},
-- module_error="value"
- [8] = {
+ {
str = "^%s*([%w_]+)_error%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
process = function(k, v)
config.setKey(k, "error", v)
- end
+ end,
},
-- exec="command"
- [9] = {
+ {
str = "^%s*exec%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
process = function(k, _)
if loader.perform(k) ~= 0 then
print("Failed to exec '" .. k .. "'")
end
- end
+ end,
},
-- env_var="value"
- [10] = {
+ {
str = "^%s*([%w%p]+)%s*=%s*\"([%w%s%p]-)\"%s*(.*)",
process = function(k, v)
if config.setenv(k, v) ~= 0 then
print("Failed to set '" .. k ..
"' with value: " .. v .. "")
end
- end
+ end,
},
-- env_var=num
- [11] = {
+ {
str = "^%s*([%w%p]+)%s*=%s*(%d+)%s*(.*)",
process = function(k, v)
if config.setenv(k, v) ~= 0 then
print("Failed to set '" .. k ..
"' with value: " .. v .. "")
end
- end
- }
+ end,
+ },
}
local function readFile(name, silent)