patch 8.2.2677: Vim9: cannot use only some of the default arguments
Problem: Vim9: cannot use only some of the default arguments.
Solution: Use v:none to use default argument value. Remove
uf_def_arg_idx[], use JUMP_IF_ARG_SET. (closes #6504)
diff --git a/src/vim9.h b/src/vim9.h
index a0757fd..0c8a949 100644
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -92,6 +92,7 @@
// expression operations
ISN_JUMP, // jump if condition is matched isn_arg.jump
+ ISN_JUMP_IF_ARG_SET, // jump if argument is already set, uses isn_arg.jumparg
// loop
ISN_FOR, // get next item from a list, uses isn_arg.forloop
@@ -203,6 +204,12 @@
int jump_where; // position to jump to
} jump_T;
+// arguments to ISN_JUMP_IF_ARG_SET
+typedef struct {
+ int jump_arg_off; // argument index, negative
+ int jump_where; // position to jump to
+} jumparg_T;
+
// arguments to ISN_FOR
typedef struct {
int for_idx; // loop variable index
@@ -346,6 +353,7 @@
job_T *job;
partial_T *partial;
jump_T jump;
+ jumparg_T jumparg;
forloop_T forloop;
try_T try;
trycont_T trycont;