diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-23 19:46:28 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-23 19:46:28 +0100 |
commit | 520e1e41f35b063ede63b41738c82d6636e78c34 (patch) | |
tree | 4c6a94e4e8f3f2047b91886077d4ecb916b30401 /src/if_py_both.h | |
parent | 6920c72d4d62c8dc5596e9f392e38204f561d7af (diff) |
patch 7.4.1154v7.4.1154
Problem: No support for JSON.
Solution: Add jsonencode() and jsondecode(). Also add v:false, v:true,
v:null and v:none.
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r-- | src/if_py_both.h | 19 |
1 files changed, 19 insertions, 0 deletions
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); |