]> granicus.if.org Git - vim/commitdiff
patch 7.4.1688 v7.4.1688
authorBram Moolenaar <Bram@vim.org>
Wed, 30 Mar 2016 20:03:02 +0000 (22:03 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 30 Mar 2016 20:03:02 +0000 (22:03 +0200)
Problem:    MzScheme does not support partial.
Solution:   Add minimal partial support. (Ken Takata)

src/if_mzsch.c
src/version.c

index d255d4adf113db8242a2cfeebb500f3ed40ce6d2..93e4b6cbba039410421f3d68bfb17e36711dde59 100644 (file)
@@ -3109,6 +3109,7 @@ vim_to_mzscheme_impl(typval_T *vim_value, int depth, Scheme_Hash_Table *visited)
        MZ_GC_VAR_IN_REG(0, funcname);
        MZ_GC_REG();
 
+       /* FIXME: func_ref() and func_unref() are needed. */
        funcname = scheme_make_byte_string((char *)vim_value->vval.v_string);
        MZ_GC_CHECK();
        result = scheme_make_closed_prim_w_arity(vim_funcref, funcname,
@@ -3117,6 +3118,30 @@ vim_to_mzscheme_impl(typval_T *vim_value, int depth, Scheme_Hash_Table *visited)
 
        MZ_GC_UNREG();
     }
+    else if (vim_value->v_type == VAR_PARTIAL)
+    {
+       if (vim_value->vval.v_partial == NULL)
+           result = scheme_null;
+       else
+       {
+           Scheme_Object *funcname = NULL;
+
+           MZ_GC_DECL_REG(1);
+           MZ_GC_VAR_IN_REG(0, funcname);
+           MZ_GC_REG();
+
+           /* FIXME: func_ref() and func_unref() are needed. */
+           /* TODO: Support pt_dict and pt_argv. */
+           funcname = scheme_make_byte_string(
+                   (char *)vim_value->vval.v_partial->pt_name);
+           MZ_GC_CHECK();
+           result = scheme_make_closed_prim_w_arity(vim_funcref, funcname,
+                   (const char *)BYTE_STRING_VALUE(funcname), 0, -1);
+           MZ_GC_CHECK();
+
+           MZ_GC_UNREG();
+       }
+    }
     else if (vim_value->v_type == VAR_SPECIAL)
     {
        if (vim_value->vval.v_number <= VVAL_TRUE)
index 6e599d813a4acda11aad8dff2a815f33f1dc4e2c..c7e1639d4267aaa07cb0f7aade98ca12005da880 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1688,
 /**/
     1687,
 /**/