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 #7345)
diff --git a/src/vim9.h b/src/vim9.h
index 9685b9d..1368b38 100644
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -146,6 +146,7 @@
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 @@
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 @@
shuffle_T shuffle;
put_T put;
cmod_T cmdmod;
+ unpack_T unpack;
} isn_arg;
};