Skip to content
Dibyendu Majumdar edited this page Jan 20, 2018 · 1 revision

Lua Type codes

** tags for Tagged Values have the following use of bits:
** bits 0-3: actual tag (a LUA_T* value)
** bits 4-5: variant bits
** bit 6: whether value is collectable

LUA_TNIL             0                              0000 0000
LUA_TBOOLEAN         1                              0000 0001
LUA_TLIGHTUSERDATA   2                              0000 0010
LUA_TNUMBER          3                              0000 0011
LUA_TNUMFLT          (LUA_TNUMBER | (0 << 4))       0000 0011
LUA_TNUMINT          (LUA_TNUMBER | (1 << 4))       0001 0011
LUA_TSTRING          4                              0000 0100
LUA_TSHRSTR          (LUA_TSTRING | (0 << 4))       0000 0100
LUA_TLNGSTR          (LUA_TSTRING | (1 << 4))       0001 0100
LUA_TTABLE           5                              0000 0101
RAVI_TIARRAY         (LUA_TTABLE | (1 << 4))        0001 0101
RAVI_TFARRAY         (LUA_TTABLE | (2 << 4))        0010 0101
LUA_TFUNCTION        6                              0000 0110
LUA_TLCL	     (LUA_TFUNCTION | (0 << 4))     0000 0110
LUA_TLCF             (LUA_TFUNCTION | (1 << 4))     0001 0110
LUA_TCCL             (LUA_TFUNCTION | (2 << 4))     0010 0110
LUA_TUSERDATA        7                              0000 0111
LUA_TTHREAD          8                              0000 1000
Clone this wiki locally