Meh I'll figure out submodules later
This commit is contained in:
parent
4ca9d44a90
commit
8cb281f436
352 changed files with 66107 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
---@brief [[
|
||||
---Do not edit this file, it was generated!
|
||||
---Provides a function to rotate a lua vararg
|
||||
---@brief ]]
|
||||
|
||||
local tbl = require('plenary.tbl')
|
||||
|
||||
local rotate_lookup = {}
|
||||
|
||||
{% for n in range(1, amount) %}
|
||||
rotate_lookup[{{n}}] = function ({% for n in range(n) %} A{{n}} {{ ", " if not loop.last else "" }} {% endfor %})
|
||||
return {% for n in range(1, n) %} A{{n}}, {% endfor %} A0
|
||||
end
|
||||
{% endfor %}
|
||||
|
||||
local function rotate_n(first, ...)
|
||||
local n = select("#", ...) + 1
|
||||
local args = tbl.pack(...)
|
||||
args[n] = first
|
||||
return tbl.unpack(args, 1, n)
|
||||
end
|
||||
|
||||
local function rotate(nargs, ...)
|
||||
if nargs == nil or nargs < 1 then
|
||||
return
|
||||
end
|
||||
return (rotate_lookup[nargs] or rotate_n)(...)
|
||||
end
|
||||
|
||||
return rotate
|
||||
Loading…
Add table
Add a link
Reference in a new issue