0
0
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:
Bram Moolenaar
2016-01-23 19:46:28 +01:00
parent 6920c72d4d
commit 520e1e41f3
28 changed files with 863 additions and 34 deletions

View File

@@ -810,6 +810,25 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict)
}
}
}
else if (our_tv->v_type == VAR_SPECIAL)
{
if (our_tv->vval.v_number == VVAL_FALSE)
{
ret = Py_False;
Py_INCREF(ret);
}
else if (our_tv->vval.v_number == VVAL_TRUE)
{
ret = Py_True;
Py_INCREF(ret);
}
else
{
Py_INCREF(Py_None);
ret = Py_None;
}
return ret;
}
else
{
Py_INCREF(Py_None);