summaryrefslogtreecommitdiff
path: root/src/if_mzsch.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-23 19:46:28 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-23 19:46:28 +0100
commit520e1e41f35b063ede63b41738c82d6636e78c34 (patch)
tree4c6a94e4e8f3f2047b91886077d4ecb916b30401 /src/if_mzsch.c
parent6920c72d4d62c8dc5596e9f392e38204f561d7af (diff)
downloadvim-git-520e1e41f35b063ede63b41738c82d6636e78c34.tar.gz
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_mzsch.c')
-rw-r--r--src/if_mzsch.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/if_mzsch.c b/src/if_mzsch.c
index ea0470545..0884c9f5e 100644
--- a/src/if_mzsch.c
+++ b/src/if_mzsch.c
@@ -3084,6 +3084,14 @@ vim_to_mzscheme_impl(typval_T *vim_value, int depth, Scheme_Hash_Table *visited)
MZ_GC_UNREG();
}
+ else if (vim_value->v_type == VAR_SPECIAL)
+ {
+ if (vim_value->vval.v_number <= VVAL_TRUE)
+ result = scheme_make_integer((long)vim_value->vval.v_number);
+ else
+ result = scheme_null;
+ MZ_GC_CHECK();
+ }
else
{
result = scheme_void;
@@ -3148,8 +3156,8 @@ mzscheme_to_vim_impl(Scheme_Object *obj, typval_T *tv, int depth,
copy_tv(found, tv);
else if (SCHEME_VOIDP(obj))
{
- tv->v_type = VAR_NUMBER;
- tv->vval.v_number = 0;
+ tv->v_type = VAR_SPECIAL;
+ tv->vval.v_number = VVAL_NULL;
}
else if (SCHEME_INTP(obj))
{
@@ -3158,7 +3166,7 @@ mzscheme_to_vim_impl(Scheme_Object *obj, typval_T *tv, int depth,
}
else if (SCHEME_BOOLP(obj))
{
- tv->v_type = VAR_NUMBER;
+ tv->v_type = VAR_SPECIAL;
tv->vval.v_number = SCHEME_TRUEP(obj);
}
# ifdef FEAT_FLOAT