summaryrefslogtreecommitdiff
path: root/src/vim9.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-16 11:34:42 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-16 11:34:42 +0200
commit9af78769eeae0318e07aa8b6af4d6e2244481ca7 (patch)
tree995f0acd6a0098a714f8dbc5434e0b9d9701828d /src/vim9.h
parentc70222d12a2f8552273c0de48a3bf7138d649175 (diff)
downloadvim-git-9af78769eeae0318e07aa8b6af4d6e2244481ca7.tar.gz
patch 8.2.0987: Vim9: cannot assign to [var; var]v8.2.0987
Problem: Vim9: cannot assign to [var; var]. Solution: Assign rest of items to a list.
Diffstat (limited to 'src/vim9.h')
-rw-r--r--src/vim9.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vim9.h b/src/vim9.h
index 66b088290..259bdb911 100644
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -112,6 +112,7 @@ typedef enum {
// expression operations
ISN_CONCAT,
ISN_INDEX, // [expr] list index
+ ISN_SLICE, // drop isn_arg.number items from start of list
ISN_GETITEM, // push list item, isn_arg.number is the index
ISN_MEMBER, // dict[member]
ISN_STRINGMEMBER, // dict.member using isn_arg.string
@@ -121,6 +122,7 @@ typedef enum {
ISN_CHECKNR, // check value can be used as a number
ISN_CHECKTYPE, // check value type is isn_arg.type.tc_type
+ ISN_CHECKLEN, // check list length is isn_arg.checklen.cl_min_len
ISN_DROP // pop stack and discard value
} isntype_T;
@@ -229,6 +231,12 @@ typedef struct {
int fr_var_idx; // variable to store partial
} funcref_T;
+// arguments to ISN_CHECKLEN
+typedef struct {
+ int cl_min_len; // minimum length
+ int cl_more_OK; // longer is allowed
+} checklen_T;
+
/*
* Instruction
*/
@@ -261,6 +269,7 @@ struct isn_S {
script_T script;
unlet_T unlet;
funcref_T funcref;
+ checklen_T checklen;
} isn_arg;
};