summaryrefslogtreecommitdiff
path: root/src/lua.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-02 15:38:51 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-02 15:48:11 +0100
commit066719cf3db7f67d4373acb1398e9ca3a2dde3ed (patch)
tree44ce04e5517dead2ba97efc78588915d777738a6 /src/lua.js
parentbad73671ca959f292becb8c68b73a14380aeeb56 (diff)
downloadfengari-066719cf3db7f67d4373acb1398e9ca3a2dde3ed.tar.gz
fengari-066719cf3db7f67d4373acb1398e9ca3a2dde3ed.tar.bz2
fengari-066719cf3db7f67d4373acb1398e9ca3a2dde3ed.zip
readConstants
Diffstat (limited to 'src/lua.js')
-rw-r--r--src/lua.js25
1 files changed, 25 insertions, 0 deletions
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