Mercurial > vim
diff src/vim9.h @ 24272:cabed216cc2f v8.2.2677
patch 8.2.2677: Vim9: cannot use only some of the default arguments
Commit: https://github.com/vim/vim/commit/38a3bfa9a2931729a5e0c28dc087f745b68988ef
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Mar 29 22:14:55 2021 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 29 Mar 2021 22:15:03 +0200 |
parents | 40e27d96e395 |
children | aa150abca273 |
line wrap: on
line diff
--- a/src/vim9.h +++ b/src/vim9.h @@ -92,6 +92,7 @@ typedef enum { // 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 @@ typedef struct { 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 @@ struct isn_S { job_T *job; partial_T *partial; jump_T jump; + jumparg_T jumparg; forloop_T forloop; try_T try; trycont_T trycont;