-
Notifications
You must be signed in to change notification settings - Fork 347
Lua 5.3 Changes
viruscamp edited this page Nov 12, 2014
·
3 revisions
- new datatype integer
0 is integer and 0.0 is double
- sprintf(ret, LUA_NUMBER_FMT, nvalue(o));
+ sprintf(ret, LUA_NUMBER_FMT, fltvalue(o));
+ sprintf(ret, LUA_INTEGER_FMT, ivalue(o));
- subtypes
/* Variant tags for strings */
#define LUA_TSHRSTR (LUA_TSTRING | (0 << 4)) /* short strings */
#define LUA_TLNGSTR (LUA_TSTRING | (1 << 4)) /* long strings */
/* Variant tags for numbers */
#define LUA_TNUMFLT (LUA_TNUMBER | (0 << 4)) /* float numbers */
#define LUA_TNUMINT (LUA_TNUMBER | (1 << 4)) /* integer numbers */
- TString format changed
#if LUA_VERSION_NUM == 501 || LUA_VERSION_NUM == 502
#define rawtsvalue(o) check_exp(ttisstring(o), &(o)->value.gc->ts)
#define tsvalue(o) (&rawtsvalue(o)->tsv)
#define LUA_STRLEN(ts) ((ts)->tsv.len)
#endif
#if LUA_VERSION_NUM == 503
#define tsvalue(o) check_exp(ttisstring(o), gco2ts(val_(o).gc))
#define rawtsvalue(o) tsvalue(o)
#define LUA_STRLEN(ts) ((ts)->len)
#endif
- new operators
OP_IDIV,/* A B C R(A) := RK(B) // RK(C) */
OP_BAND,/* A B C R(A) := RK(B) & RK(C) */
OP_BOR,/* A B C R(A) := RK(B) | RK(C) */
OP_BXOR,/* A B C R(A) := RK(B) ~ RK(C) */
OP_SHL,/* A B C R(A) := RK(B) << RK(C) */
OP_SHR,/* A B C R(A) := RK(B) >> RK(C) */
OP_BNOT,/* A B R(A) := ~R(B) */