From 520e1e41f35b063ede63b41738c82d6636e78c34 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 23 Jan 2016 19:46:28 +0100 Subject: 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. --- src/if_py_both.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/if_py_both.h') diff --git a/src/if_py_both.h b/src/if_py_both.h index e220e3fec7..e8a5f5de9c 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -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); -- cgit v1.2.3