mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-26 04:17:33 +00:00
Preserve ordering of generated Lua code (#1646)
* Preserve ordering of generated Lua code This fixes #1645, and (partially) reverts 68ac28.
This commit is contained in:
parent
23a1ad3848
commit
bbdc7081ae
1
3rdparty/toluapp/src/bin/lua/all.lua
vendored
1
3rdparty/toluapp/src/bin/lua/all.lua
vendored
@ -6,6 +6,7 @@ dofile(path.."basic.lua")
|
||||
dofile(path.."code.lua")
|
||||
dofile(path.."typedef.lua")
|
||||
dofile(path.."container.lua")
|
||||
dofile(path.."ordered_pairs.lua")
|
||||
dofile(path.."package.lua")
|
||||
dofile(path.."module.lua")
|
||||
dofile(path.."namespace.lua")
|
||||
|
18
3rdparty/toluapp/src/bin/lua/ordered_pairs.lua
vendored
Normal file
18
3rdparty/toluapp/src/bin/lua/ordered_pairs.lua
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
local P = {}
|
||||
op = P
|
||||
|
||||
function P:ordered_pairs(t)
|
||||
local i = {}
|
||||
for k in next, t do
|
||||
table.insert(i, k)
|
||||
end
|
||||
table.sort(i)
|
||||
return function()
|
||||
local k = table.remove(i)
|
||||
if k ~= nil then
|
||||
return k, t[k]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return op
|
4
3rdparty/toluapp/src/bin/lua/package.lua
vendored
4
3rdparty/toluapp/src/bin/lua/package.lua
vendored
@ -133,7 +133,7 @@ function classPackage:preamble ()
|
||||
output('\n')
|
||||
output('/* function to release collected object via destructor */')
|
||||
output('#ifdef __cplusplus\n')
|
||||
for i,v in ipairs(_collect) do
|
||||
for i,v in op:ordered_pairs(_collect) do
|
||||
output('\nstatic int '..v..' (lua_State* tolua_S)')
|
||||
output('{')
|
||||
output(' '..i..'* self = ('..i..'*) tolua_tousertype(tolua_S,1,0);')
|
||||
@ -152,7 +152,7 @@ function classPackage:preamble ()
|
||||
if flags.t then
|
||||
output("#ifndef Mtolua_typeid\n#define Mtolua_typeid(L,TI,T)\n#endif\n")
|
||||
end
|
||||
for n,v in ipairs(_usertype) do
|
||||
for n,v in op:ordered_pairs(_usertype) do
|
||||
if (not _global_classes[v]) or _global_classes[v]:check_public_access() then
|
||||
output(' tolua_usertype(tolua_S,"',v,'");')
|
||||
if flags.t then
|
||||
|
Loading…
Reference in New Issue
Block a user