@@ -253,14 +253,23 @@ void (*dll_lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);
253253void (* dll_lua_pushboolean ) (lua_State * L , int b );
254254void (* dll_lua_pushlightuserdata ) (lua_State * L , void * p );
255255void (* dll_lua_getfield ) (lua_State * L , int idx , const char * k );
256+ #if LUA_VERSION_NUM <= 502
256257void (* dll_lua_rawget ) (lua_State * L , int idx );
257258void (* 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
258263void (* dll_lua_createtable ) (lua_State * L , int narr , int nrec );
259264void * (* dll_lua_newuserdata ) (lua_State * L , size_t sz );
260265int (* dll_lua_getmetatable ) (lua_State * L , int objindex );
261266void (* dll_lua_setfield ) (lua_State * L , int idx , const char * k );
262267void (* dll_lua_rawset ) (lua_State * L , int idx );
268+ #if LUA_VERSION_NUM <= 502
263269void (* 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
264273int (* dll_lua_setmetatable ) (lua_State * L , int objindex );
265274int (* dll_lua_next ) (lua_State * L , int idx );
266275/* libs */
@@ -962,7 +971,8 @@ luaV_dict_newindex(lua_State *L)
962971 return 0 ;
963972 if (* key == NUL )
964973 luaL_error (L , "empty key" );
965- if (!lua_isnil (L , 3 )) { /* read value? */
974+ if (!lua_isnil (L , 3 )) /* read value? */
975+ {
966976 luaV_checktypval (L , 3 , & v , "setting dict item" );
967977 if (d -> dv_scope == VAR_DEF_SCOPE && v .v_type == VAR_FUNC )
968978 luaL_error (L , "cannot assign funcref to builtin scope" );
@@ -1074,7 +1084,8 @@ luaV_funcref_call(lua_State *L)
10741084 status = FAIL ;
10751085 else
10761086 {
1077- for (i = 0 ; i < n ; i ++ ) {
1087+ for (i = 0 ; i < n ; i ++ )
1088+ {
10781089 luaV_checktypval (L , i + 2 , & v , "calling funcref" );
10791090 list_append_tv (f -> args .vval .v_list , & v );
10801091 }
@@ -1531,13 +1542,16 @@ luaV_list(lua_State *L)
15311542 else
15321543 {
15331544 luaV_newlist (L , l );
1534- if (initarg ) { /* traverse table to init dict */
1545+ if (initarg ) /* traverse table to init list */
1546+ {
15351547 int notnil , i = 0 ;
15361548 typval_T v ;
1537- do {
1549+ do
1550+ {
15381551 lua_rawgeti (L , 1 , ++ i );
15391552 notnil = !lua_isnil (L , -1 );
1540- if (notnil ) {
1553+ if (notnil )
1554+ {
15411555 luaV_checktypval (L , -1 , & v , "vim.list" );
15421556 list_append_tv (l , & v );
15431557 }
0 commit comments