mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-26 00:53:00 +00:00
//many, //multi, parse_reference: various luacheck fixes
This commit is contained in:
parent
c14bb40f7e
commit
655d9ebac9
3 changed files with 3 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
-- explode(separator, string)
|
-- explode(separator, string)
|
||||||
-- From http://lua-users.org/wiki/SplitJoin
|
-- From http://lua-users.org/wiki/SplitJoin
|
||||||
|
-- TODO: Refactor this to use wea.split instead
|
||||||
local function explode(delim, str)
|
local function explode(delim, str)
|
||||||
local ll, is_done
|
local ll, is_done
|
||||||
local delim_length = string.len(delim)
|
local delim_length = string.len(delim)
|
||||||
|
@ -12,7 +13,7 @@ local function explode(delim, str)
|
||||||
return function()
|
return function()
|
||||||
if is_done then return end
|
if is_done then return end
|
||||||
|
|
||||||
local result = nil
|
local result
|
||||||
local loc = string.find(str, delim, ll, true) -- find the next d in the string
|
local loc = string.find(str, delim, ll, true) -- find the next d in the string
|
||||||
if loc ~= nil then -- if "not not" found then..
|
if loc ~= nil then -- if "not not" found then..
|
||||||
result = string.sub(str, ll, loc - 1) -- Save it in our array.
|
result = string.sub(str, ll, loc - 1) -- Save it in our array.
|
||||||
|
|
|
@ -35,8 +35,6 @@ minetest.register_chatcommand("/multi", {
|
||||||
params_text = worldeditadditions.trim(params_text)
|
params_text = worldeditadditions.trim(params_text)
|
||||||
if #params_text == 0 then return false, "Error: No commands specified, so there's nothing to do." end
|
if #params_text == 0 then return false, "Error: No commands specified, so there's nothing to do." end
|
||||||
|
|
||||||
|
|
||||||
local i = 1 -- For feedback only
|
|
||||||
local master_start_time = worldeditadditions.get_ms_time()
|
local master_start_time = worldeditadditions.get_ms_time()
|
||||||
local times = {}
|
local times = {}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ function worldeditadditions.doc.parse_reference()
|
||||||
function(item, i) return item.level ~= 2 end
|
function(item, i) return item.level ~= 2 end
|
||||||
)
|
)
|
||||||
for i,value in ipairs(headings) do
|
for i,value in ipairs(headings) do
|
||||||
print(i, "level", level, "heading", heading, "text", text)
|
print(i, "level", value.level, "heading", value.heading, "text", value.text)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue