aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2018-08-29 18:28:29 +0000
committerbloodstalker <thabogre@gmail.com>2018-08-29 18:28:29 +0000
commit49968b6a896cf5dc76c93e5983ef2185a97c44a8 (patch)
treebdad5ac58224ded0982e9df31fea631c532a4ba6
parentupdate (diff)
downloadluatablegen-49968b6a896cf5dc76c93e5983ef2185a97c44a8.tar.gz
luatablegen-49968b6a896cf5dc76c93e5983ef2185a97c44a8.zip
update
-rwxr-xr-xluatablegen.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/luatablegen.py b/luatablegen.py
index 01fcfe5..ed1fe15 100755
--- a/luatablegen.py
+++ b/luatablegen.py
@@ -52,18 +52,14 @@ REGISTER_META = ['static const luaL_Reg XXX_meta[] = {\n',
TABLE_REGISTER = ['int XXX_register(lua_State* __ls) {\n',
'lua_newtable(__ls);\n',
'luaL_setfuncs(__ls, XXX_methods, 0);\n',
- 'lua_setglobal(__ls, "XXX");\n',
- '\tluaL_newmetatable(__ls, "XXX");\n',
- 'lua_newtable(__ls);\n',
+ 'luaL_newmetatable(__ls, "XXX");\n',
'luaL_setfuncs(__ls, XXX_meta, 0);\n',
- 'lua_setglobal(__ls, 0);\n',
- '\tlua_pushliteral(__ls, "__index");\n',
- '\tlua_pushvalue(__ls, -3);\n',
- '\tlua_rawset(__ls, -3);\n',
- '\tlua_pushliteral(__ls, "__metatable");\n',
- '\tlua_pushvalue(__ls, -3);\n',
- '\tlua_rawset(__ls, -3);\n',
- '\tlua_pop(__ls, 1);\n',
+ 'lua_pushliteral(__ls, "__index");\n',
+ 'lua_pushvalue(__ls, -3);\n',
+ 'lua_rawset(__ls, -3);\n',
+ 'lua_pushliteral(__ls, "__metatable");\n',
+ 'lua_pushvalue(__ls, -3);\n',
+ 'lua_rawset(__ls, -3);\n',
'return 1;\n}\n']
SOURCE_FILE_NAME='XXX_luatablegen.c'
HEADER_FILE_NAME='XXX_luatablegen.h'