@@ -253,14 +253,23 @@ void (*dll_lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);
253
253
void (* dll_lua_pushboolean ) (lua_State * L , int b );
254
254
void (* dll_lua_pushlightuserdata ) (lua_State * L , void * p );
255
255
void (* dll_lua_getfield ) (lua_State * L , int idx , const char * k );
256
+ #if LUA_VERSION_NUM <= 502
256
257
void (* dll_lua_rawget ) (lua_State * L , int idx );
257
258
void (* dll_lua_rawgeti ) (lua_State * L , int idx , int n );
259
+ #else
260
+ int (* dll_lua_rawget ) (lua_State * L , int idx );
261
+ int (* dll_lua_rawgeti ) (lua_State * L , int idx , lua_Integer n );
262
+ #endif
258
263
void (* dll_lua_createtable ) (lua_State * L , int narr , int nrec );
259
264
void * (* dll_lua_newuserdata ) (lua_State * L , size_t sz );
260
265
int (* dll_lua_getmetatable ) (lua_State * L , int objindex );
261
266
void (* dll_lua_setfield ) (lua_State * L , int idx , const char * k );
262
267
void (* dll_lua_rawset ) (lua_State * L , int idx );
268
+ #if LUA_VERSION_NUM <= 502
263
269
void (* dll_lua_rawseti ) (lua_State * L , int idx , int n );
270
+ #else
271
+ void (* dll_lua_rawseti ) (lua_State * L , int idx , lua_Integer n );
272
+ #endif
264
273
int (* dll_lua_setmetatable ) (lua_State * L , int objindex );
265
274
int (* dll_lua_next ) (lua_State * L , int idx );
266
275
/* libs */
@@ -962,7 +971,8 @@ luaV_dict_newindex(lua_State *L)
962
971
return 0 ;
963
972
if (* key == NUL )
964
973
luaL_error (L , "empty key" );
965
- if (!lua_isnil (L , 3 )) { /* read value? */
974
+ if (!lua_isnil (L , 3 )) /* read value? */
975
+ {
966
976
luaV_checktypval (L , 3 , & v , "setting dict item" );
967
977
if (d -> dv_scope == VAR_DEF_SCOPE && v .v_type == VAR_FUNC )
968
978
luaL_error (L , "cannot assign funcref to builtin scope" );
@@ -1074,7 +1084,8 @@ luaV_funcref_call(lua_State *L)
1074
1084
status = FAIL ;
1075
1085
else
1076
1086
{
1077
- for (i = 0 ; i < n ; i ++ ) {
1087
+ for (i = 0 ; i < n ; i ++ )
1088
+ {
1078
1089
luaV_checktypval (L , i + 2 , & v , "calling funcref" );
1079
1090
list_append_tv (f -> args .vval .v_list , & v );
1080
1091
}
@@ -1531,13 +1542,16 @@ luaV_list(lua_State *L)
1531
1542
else
1532
1543
{
1533
1544
luaV_newlist (L , l );
1534
- if (initarg ) { /* traverse table to init dict */
1545
+ if (initarg ) /* traverse table to init list */
1546
+ {
1535
1547
int notnil , i = 0 ;
1536
1548
typval_T v ;
1537
- do {
1549
+ do
1550
+ {
1538
1551
lua_rawgeti (L , 1 , ++ i );
1539
1552
notnil = !lua_isnil (L , -1 );
1540
- if (notnil ) {
1553
+ if (notnil )
1554
+ {
1541
1555
luaV_checktypval (L , -1 , & v , "vim.list" );
1542
1556
list_append_tv (l , & v );
1543
1557
}
0 commit comments