svn commit: r329944 - head/stand/lua

Kyle Evans kevans at FreeBSD.org
Sun Feb 25 03:30:25 UTC 2018


Author: kevans
Date: Sun Feb 25 03:30:24 2018
New Revision: 329944
URL: https://svnweb.freebsd.org/changeset/base/329944

Log:
  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.

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==============================================================================
--- head/stand/lua/config.lua	Sun Feb 25 00:35:21 2018	(r329943)
+++ head/stand/lua/config.lua	Sun Feb 25 03:30:24 2018	(r329944)
@@ -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)


More information about the svn-src-head mailing list