mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-16 13:59:55 +02:00
Add ltn12.source.table()
This commit is contained in:
@ -128,6 +128,16 @@ function source.string(s)
|
||||
else return source.empty() end
|
||||
end
|
||||
|
||||
-- creates table source
|
||||
function source.table(t)
|
||||
base.assert('table' == type(t))
|
||||
local i = 0
|
||||
return function()
|
||||
i = i + 1
|
||||
return t[i]
|
||||
end
|
||||
end
|
||||
|
||||
-- creates rewindable source
|
||||
function source.rewind(src)
|
||||
base.assert(src)
|
||||
|
Reference in New Issue
Block a user