28 lines
860 B
Lua
28 lines
860 B
Lua
|
#!/usr/bin/lua
|
||
|
|
||
|
-- Bootstrap, this is required for engine
|
||
|
mainScriptPath = (debug.getinfo(1, "S").source:sub(2):match("(.*[/\\])") or "./"):sub(1,-2)
|
||
|
package.path = mainScriptPath.. "/lib/?.lua;" ..mainScriptPath.. "/lib/?/init.lua;" ..package.path
|
||
|
|
||
|
function main()
|
||
|
local engine = require("engine")
|
||
|
local el1 = engine.element.create("example")
|
||
|
local el2 = engine.element.create("example")
|
||
|
local el3 = engine.element.create("example")
|
||
|
engine.element.attach(el2,el1)
|
||
|
engine.element.attach(el3,el1)
|
||
|
engine.element.destroy(el1)
|
||
|
local tableHelper = require("tableHelper")
|
||
|
local memDebug = require("memDebug")
|
||
|
print("")
|
||
|
print("-- GLOBALS --")
|
||
|
print(tableHelper.toString(_G))
|
||
|
print("")
|
||
|
print("-- LOCALS --")
|
||
|
print(tableHelper.toString(memDebug.locals()))
|
||
|
print("")
|
||
|
print("-- UPVALUES --")
|
||
|
print(tableHelper.toString(memDebug.upvalues()))
|
||
|
end
|
||
|
|
||
|
main()
|