aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-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'