]> granicus.if.org Git - vim/commitdiff
patch 8.2.0538: Vim9: VAR_PARTIAL is not used during compilation v8.2.0538
authorBram Moolenaar <Bram@vim.org>
Thu, 9 Apr 2020 19:08:09 +0000 (21:08 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 9 Apr 2020 19:08:09 +0000 (21:08 +0200)
Problem:    Vim9: VAR_PARTIAL is not used during compilation.
Solution:   Remove VAR_PARTIAL.

src/version.c
src/vim9.h
src/vim9compile.c
src/vim9execute.c

index fece1a10396bff64a07c16a014f010fd0fcd5165..0c147cce9801ba2939704d382cad7f718d0530d6 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    538,
 /**/
     537,
 /**/
index 0c59b06ced382df19168c33bbc9f6c6a6a96aeb2..57cbfead331e268dbe6f83cb307789702dcd4408 100644 (file)
@@ -46,7 +46,6 @@ typedef enum {
     ISN_PUSHS,         // push string isn_arg.string
     ISN_PUSHBLOB,      // push blob isn_arg.blob
     ISN_PUSHFUNC,      // push func isn_arg.string
-    ISN_PUSHPARTIAL,   // push partial ?
     ISN_PUSHCHANNEL,   // push channel isn_arg.channel
     ISN_PUSHJOB,       // push channel isn_arg.job
     ISN_NEWLIST,       // push list from stack items, size is isn_arg.number
@@ -92,7 +91,6 @@ typedef enum {
     ISN_COMPARELIST,
     ISN_COMPAREDICT,
     ISN_COMPAREFUNC,
-    ISN_COMPAREPARTIAL,
     ISN_COMPAREANY,
 
     // expression operations
index 0bc50c3e02d7d7f8b56c1604e267a2131611cf83..90f7d2841331e73934dbb3fe66247067d656db7c 100644 (file)
@@ -396,7 +396,7 @@ typval2type(typval_T *tv)
     if (tv->v_type == VAR_NUMBER)
        return &t_number;
     if (tv->v_type == VAR_BOOL)
-       return &t_bool;
+       return &t_bool;  // not used
     if (tv->v_type == VAR_STRING)
        return &t_string;
     if (tv->v_type == VAR_LIST)  // e.g. for v:oldfiles
@@ -642,7 +642,6 @@ generate_COMPARE(cctx_T *cctx, exptype_T exptype, int ic)
            case VAR_LIST: isntype = ISN_COMPARELIST; break;
            case VAR_DICT: isntype = ISN_COMPAREDICT; break;
            case VAR_FUNC: isntype = ISN_COMPAREFUNC; break;
-           case VAR_PARTIAL: isntype = ISN_COMPAREPARTIAL; break;
            default: isntype = ISN_COMPAREANY; break;
        }
     }
@@ -879,23 +878,6 @@ generate_PUSHFUNC(cctx_T *cctx, char_u *name, type_T *type)
     return OK;
 }
 
-/*
- * Generate an ISN_PUSHPARTIAL instruction with partial "part".
- * Consumes "part".
- */
-    static int
-generate_PUSHPARTIAL(cctx_T *cctx, partial_T *part)
-{
-    isn_T      *isn;
-
-    RETURN_OK_IF_SKIP(cctx);
-    if ((isn = generate_instr_type(cctx, ISN_PUSHPARTIAL, &t_func_any)) == NULL)
-       return FAIL;
-    isn->isn_arg.partial = part;
-
-    return OK;
-}
-
 /*
  * Generate an ISN_STORE instruction.
  */
@@ -4165,9 +4147,6 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
            case VAR_FUNC:
                generate_PUSHFUNC(cctx, NULL, &t_func_void);
                break;
-           case VAR_PARTIAL:
-               generate_PUSHPARTIAL(cctx, NULL);
-               break;
            case VAR_LIST:
                generate_NEWLIST(cctx, 0);
                break;
@@ -4183,6 +4162,7 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
            case VAR_NUMBER:
            case VAR_UNKNOWN:
            case VAR_ANY:
+           case VAR_PARTIAL:
            case VAR_VOID:
            case VAR_SPECIAL:  // cannot happen
                generate_PUSHNR(cctx, 0);
@@ -6018,10 +5998,6 @@ delete_instr(isn_T *isn)
            blob_unref(isn->isn_arg.blob);
            break;
 
-       case ISN_PUSHPARTIAL:
-           partial_unref(isn->isn_arg.partial);
-           break;
-
        case ISN_PUSHJOB:
 #ifdef FEAT_JOB_CHANNEL
            job_unref(isn->isn_arg.job);
@@ -6054,7 +6030,6 @@ delete_instr(isn_T *isn)
        case ISN_COMPAREFUNC:
        case ISN_COMPARELIST:
        case ISN_COMPARENR:
-       case ISN_COMPAREPARTIAL:
        case ISN_COMPARESPECIAL:
        case ISN_COMPARESTRING:
        case ISN_CONCAT:
index b7ec9798c3c049a07b364ded8e42cdbbb804a82d..d9b87c18dcf5425bb76433721f77b13ff998e9e1 100644 (file)
@@ -858,7 +858,6 @@ call_def_function(
            case ISN_PUSHS:
            case ISN_PUSHBLOB:
            case ISN_PUSHFUNC:
-           case ISN_PUSHPARTIAL:
            case ISN_PUSHCHANNEL:
            case ISN_PUSHJOB:
                if (ga_grow(&ectx.ec_stack, 1) == FAIL)
@@ -896,12 +895,6 @@ call_def_function(
                            tv->vval.v_string =
                                             vim_strsave(iptr->isn_arg.string);
                        break;
-                   case ISN_PUSHPARTIAL:
-                       tv->v_type = VAR_PARTIAL;
-                       tv->vval.v_partial = iptr->isn_arg.partial;
-                       if (tv->vval.v_partial != NULL)
-                           ++tv->vval.v_partial->pt_refcount;
-                       break;
                    case ISN_PUSHCHANNEL:
 #ifdef FEAT_JOB_CHANNEL
                        tv->v_type = VAR_CHANNEL;
@@ -1412,7 +1405,6 @@ call_def_function(
            case ISN_COMPARESTRING:
            case ISN_COMPAREDICT:
            case ISN_COMPAREFUNC:
-           case ISN_COMPAREPARTIAL:
            case ISN_COMPAREANY:
                {
                    typval_T    *tv1 = STACK_TV_BOT(-2);
@@ -1932,14 +1924,6 @@ ex_disassemble(exarg_T *eap)
                                               name == NULL ? "[none]" : name);
                }
                break;
-           case ISN_PUSHPARTIAL:
-               {
-                   partial_T *part = iptr->isn_arg.partial;
-
-                   smsg("%4d PUSHPARTIAL \"%s\"", current,
-                        part == NULL ? "[none]" : (char *)partial_name(part));
-               }
-               break;
            case ISN_PUSHCHANNEL:
 #ifdef FEAT_JOB_CHANNEL
                {
@@ -2117,7 +2101,6 @@ ex_disassemble(exarg_T *eap)
            case ISN_COMPARELIST:
            case ISN_COMPAREDICT:
            case ISN_COMPAREFUNC:
-           case ISN_COMPAREPARTIAL:
            case ISN_COMPAREANY:
                   {
                       char *p;
@@ -2154,8 +2137,6 @@ ex_disassemble(exarg_T *eap)
                           case ISN_COMPARELIST: type = "COMPARELIST"; break;
                           case ISN_COMPAREDICT: type = "COMPAREDICT"; break;
                           case ISN_COMPAREFUNC: type = "COMPAREFUNC"; break;
-                          case ISN_COMPAREPARTIAL:
-                                                type = "COMPAREPARTIAL"; break;
                           case ISN_COMPAREANY: type = "COMPAREANY"; break;
                           default: type = "???"; break;
                       }