mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 7.4.1154
Problem: No support for JSON. Solution: Add jsonencode() and jsondecode(). Also add v:false, v:true, v:null and v:none.
This commit is contained in:
@@ -499,6 +499,12 @@ luaV_pushtypval(lua_State *L, typval_T *tv)
|
||||
case VAR_DICT:
|
||||
luaV_pushdict(L, tv->vval.v_dict);
|
||||
break;
|
||||
case VAR_SPECIAL:
|
||||
if (tv->vval.v_number <= VVAL_TRUE)
|
||||
lua_pushinteger(L, (int) tv->vval.v_number);
|
||||
else
|
||||
lua_pushnil(L);
|
||||
break;
|
||||
default:
|
||||
lua_pushnil(L);
|
||||
}
|
||||
@@ -510,7 +516,7 @@ luaV_totypval (lua_State *L, int pos, typval_T *tv)
|
||||
{
|
||||
switch(lua_type(L, pos)) {
|
||||
case LUA_TBOOLEAN:
|
||||
tv->v_type = VAR_NUMBER;
|
||||
tv->v_type = VAR_SPECIAL;
|
||||
tv->vval.v_number = (varnumber_T) lua_toboolean(L, pos);
|
||||
break;
|
||||
case LUA_TSTRING:
|
||||
|
Reference in New Issue
Block a user