revert to fsplit

This commit is contained in:
VorTechnix 2021-07-23 10:46:23 -07:00
parent ce1ba27728
commit 72513b350a

View file

@ -48,13 +48,13 @@ end
-- @param plain boolean If true (or truthy), pattern is interpreted as a -- @param plain boolean If true (or truthy), pattern is interpreted as a
-- plain string, not a Lua pattern -- plain string, not a Lua pattern
-- @returns table A sequence table containing the substrings -- @returns table A sequence table containing the substrings
-- function worldeditadditions.split(text, pattern, plain) function worldeditadditions.split(text, pattern, plain)
-- local ret = {} local ret = {}
-- for match in worldeditadditions.gsplit(text, pattern, plain) do for match in worldeditadditions.gsplit(text, pattern, plain) do
-- table.insert(ret, match) table.insert(ret, match)
-- end end
-- return ret return ret
-- end end
--- Split a string into substrings separated by a pattern. --- Split a string into substrings separated by a pattern.
-- @param str string The string to iterate over -- @param str string The string to iterate over
@ -62,7 +62,7 @@ end
-- @param plain boolean If true (or truthy), pattern is interpreted as a -- @param plain boolean If true (or truthy), pattern is interpreted as a
-- plain string, not a Lua pattern -- plain string, not a Lua pattern
-- @returns table A sequence table containing the substrings -- @returns table A sequence table containing the substrings
function worldeditadditions.split (str,dlm,plain) function worldeditadditions.fsplit (str,dlm,plain)
local pos, ins = 0, 0 local pos, ins = 0, 0
local ret = {} local ret = {}
repeat repeat