From 066719cf3db7f67d4373acb1398e9ca3a2dde3ed Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Thu, 2 Feb 2017 15:38:51 +0100 Subject: readConstants --- src/lua.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/lua.js') diff --git a/src/lua.js b/src/lua.js index f41991e..c496c33 100644 --- a/src/lua.js +++ b/src/lua.js @@ -11,6 +11,31 @@ const thread_status = { LUA_ERRERR: 6 }; +const constant_types = { + LUA_TNONE: -1, + LUA_TNIL: 0, + LUA_TBOOLEAN: 1, + LUA_TLIGHTUSERDATA: 2, + LUA_TNUMBER: 3, + LUA_TSTRING: 4, + LUA_TTABLE: 5, + LUA_TFUNCTION: 6, + LUA_TUSERDATA: 7, + LUA_TTHREAD: 8, + LUA_NUMTAGS: 9 +}; + +constant_types.LUA_TSHRSTR = constant_types.LUA_TSTRING | (0 << 4); /* short strings */ +constant_types.LUA_TLNGSTR = constant_types.LUA_TSTRING | (1 << 4); /* long strings */ + +constant_types.LUA_TNUMFLT = constant_types.LUA_TNUMBER | (0 << 4); /* float numbers */ +constant_types.LUA_TNUMINT = constant_types.LUA_TNUMBER | (1 << 4); /* integer numbers */ + +constant_types.LUA_TLCL = constant_types.LUA_TFUNCTION | (0 << 4); /* Lua closure */ +constant_types.LUA_TLCF = constant_types.LUA_TFUNCTION | (1 << 4); /* light C function */ +constant_types.LUA_TCCL = constant_types.LUA_TFUNCTION | (2 << 4); /* C closure */ + module.exports = { + constant_types: constant_types, thread_status: thread_status }; \ No newline at end of file -- cgit v1.2.3-54-g00ecf