diff src/vim9.h @ 22975:a943b175586a v8.2.2034

patch 8.2.2034: Vim9: list unpack in for statement not compiled yet Commit: https://github.com/vim/vim/commit/792f786aad8409ca9ab895392742643a5b6aed8f Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 23 08:31:18 2020 +0100 patch 8.2.2034: Vim9: list unpack in for statement not compiled yet Problem: Vim9: list unpack in for statement not compiled yet. Solution: Compile list unpack. (closes https://github.com/vim/vim/issues/7345)
author Bram Moolenaar <Bram@vim.org>
date Mon, 23 Nov 2020 08:45:04 +0100
parents 4c97c0747017
children 6aa8ddf7a3fa
line wrap: on
line diff
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -146,6 +146,7 @@ typedef enum {
     ISN_CMDMOD,	    // set cmdmod
     ISN_CMDMOD_REV, // undo ISN_CMDMOD
 
+    ISN_UNPACK,	    // unpack list into items, uses isn_arg.unpack
     ISN_SHUFFLE,    // move item on stack up or down
     ISN_DROP	    // pop stack and discard value
 } isntype_T;
@@ -284,6 +285,12 @@ typedef struct {
     cmdmod_T	*cf_cmdmod;	// allocated
 } cmod_T;
 
+// arguments to ISN_UNPACK
+typedef struct {
+    int		unp_count;	// number of items to produce
+    int		unp_semicolon;	// last item gets list of remainder
+} unpack_T;
+
 /*
  * Instruction
  */
@@ -321,6 +328,7 @@ struct isn_S {
 	shuffle_T	    shuffle;
 	put_T		    put;
 	cmod_T		    cmdmod;
+	unpack_T	    unpack;
     } isn_arg;
 };