backup
This commit is contained in:
+13
-31
@@ -73,46 +73,28 @@ do
|
|||||||
state = nil
|
state = nil
|
||||||
return temp
|
return temp
|
||||||
end
|
end
|
||||||
function public.present(v) state = v; return f end
|
function public.present(v)
|
||||||
|
state = v
|
||||||
|
return f
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
function public.vararg.L(arg)
|
||||||
local formal_parameters = t
|
local f = tremove(arg, 1)
|
||||||
for i = 1, 9 do
|
local arg1 = perm-arg
|
||||||
local key = '_' .. i
|
return vararg(function(arg)
|
||||||
public[key] = t
|
for i = 1, getn(arg) do
|
||||||
formal_parameters[_E[key]] = i
|
tinsert(arg1, arg[i])
|
||||||
end
|
|
||||||
local function helper(f, arg1, arg2)
|
|
||||||
local params = t
|
|
||||||
for i = 1, arg1.n do
|
|
||||||
if formal_parameters[arg1[i]] then
|
|
||||||
tinsert(params, arg2[formal_parameters[arg1[i]]])
|
|
||||||
else
|
|
||||||
tinsert(params, arg1[i])
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return f(unpack(params))
|
return f(unpack(arg1))
|
||||||
end
|
end)
|
||||||
function public.L(body, ...)
|
|
||||||
if type(body) == 'function' then
|
|
||||||
local arg1 = arg
|
|
||||||
return function(...) return helper(body, arg1, arg) end
|
|
||||||
else -- TODO memoization
|
|
||||||
-- body = gsub(body, '_([ab])', function(char) return '_' .. end)
|
|
||||||
-- local lambda = loadstring('return function(_1,_2,_3,_4,_5,_6,_7,_8,_9)' .. body .. ' end')
|
|
||||||
local lambda = loadstring('return ' .. body) or loadstring(body) or error()
|
|
||||||
setfenv(lambda, getfenv(2))
|
|
||||||
return lambda
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.index(t, ...) auto[arg] = true
|
function public.index(t, ...) auto[arg] = true
|
||||||
for i = 1, arg.n do t = t and t[arg[i]] end return t
|
for i = 1, arg.n do t = t and t[arg[i]] end return t
|
||||||
end
|
end
|
||||||
|
|
||||||
public.huge = 1.8*10^308
|
public.huge = 1.8 * 10 ^ 308
|
||||||
|
|
||||||
function public.modified.get() return IsShiftKeyDown() or IsControlKeyDown() or IsAltKeyDown() end
|
function public.modified.get() return IsShiftKeyDown() or IsControlKeyDown() or IsAltKeyDown() end
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -233,8 +233,8 @@ do
|
|||||||
end
|
end
|
||||||
for _, parser in temp-A(
|
for _, parser in temp-A(
|
||||||
temp-A('class', info.item_class_index),
|
temp-A('class', info.item_class_index),
|
||||||
temp-A('subclass', L(info.item_subclass_index, index(self.class, 2) or 0, _1)),
|
temp-A('subclass', L(info.item_subclass_index, index(self.class, 2) or 0)),
|
||||||
temp-A('slot', L(info.item_slot_index, index(self.class, 2) or 0, index(self.subclass, 2) or 0, _1)),
|
temp-A('slot', L(info.item_slot_index, index(self.class, 2) or 0, index(self.subclass, 2) or 0)),
|
||||||
temp-A('quality', info.item_quality_index)
|
temp-A('quality', info.item_quality_index)
|
||||||
) do
|
) do
|
||||||
if not self[parser[1]] then
|
if not self[parser[1]] then
|
||||||
|
|||||||
Reference in New Issue
Block a user