comparison src/vim9.h @ 21558:1c4d4aa22b37 v8.2.1329

patch 8.2.1329: Vim9: cannot define global function inside :def function Commit: https://github.com/vim/vim/commit/38ddf333f6b2806b0ea2dd052ee1cd50dd7f4525 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 31 22:05:04 2020 +0200 patch 8.2.1329: Vim9: cannot define global function inside :def function Problem: Vim9: cannot define global function inside :def function. Solution: Assign to global variable instead of local. (closes https://github.com/vim/vim/issues/6584)
author Bram Moolenaar <Bram@vim.org>
date Fri, 31 Jul 2020 22:15:04 +0200
parents 5cb6e676defd
children fcf978444298
comparison
equal deleted inserted replaced
21557:00c9f8522652 21558:1c4d4aa22b37
77 ISN_UCALL, // call user function or funcref/partial isn_arg.ufunc 77 ISN_UCALL, // call user function or funcref/partial isn_arg.ufunc
78 ISN_PCALL, // call partial, use isn_arg.pfunc 78 ISN_PCALL, // call partial, use isn_arg.pfunc
79 ISN_PCALL_END, // cleanup after ISN_PCALL with cpf_top set 79 ISN_PCALL_END, // cleanup after ISN_PCALL with cpf_top set
80 ISN_RETURN, // return, result is on top of stack 80 ISN_RETURN, // return, result is on top of stack
81 ISN_FUNCREF, // push a function ref to dfunc isn_arg.funcref 81 ISN_FUNCREF, // push a function ref to dfunc isn_arg.funcref
82 ISN_NEWFUNC, // create a global function from a lambda function
82 83
83 // expression operations 84 // expression operations
84 ISN_JUMP, // jump if condition is matched isn_arg.jump 85 ISN_JUMP, // jump if condition is matched isn_arg.jump
85 86
86 // loop 87 // loop
234 // arguments to ISN_FUNCREF 235 // arguments to ISN_FUNCREF
235 typedef struct { 236 typedef struct {
236 int fr_func; // function index 237 int fr_func; // function index
237 int fr_var_idx; // variable to store partial 238 int fr_var_idx; // variable to store partial
238 } funcref_T; 239 } funcref_T;
240
241 // arguments to ISN_NEWFUNC
242 typedef struct {
243 char_u *nf_lambda; // name of the lambda already defined
244 char_u *nf_global; // name of the global function to be created
245 } newfunc_T;
239 246
240 // arguments to ISN_CHECKLEN 247 // arguments to ISN_CHECKLEN
241 typedef struct { 248 typedef struct {
242 int cl_min_len; // minimum length 249 int cl_min_len; // minimum length
243 int cl_more_OK; // longer is allowed 250 int cl_more_OK; // longer is allowed
279 storeopt_T storeopt; 286 storeopt_T storeopt;
280 loadstore_T loadstore; 287 loadstore_T loadstore;
281 script_T script; 288 script_T script;
282 unlet_T unlet; 289 unlet_T unlet;
283 funcref_T funcref; 290 funcref_T funcref;
291 newfunc_T newfunc;
284 checklen_T checklen; 292 checklen_T checklen;
285 shuffle_T shuffle; 293 shuffle_T shuffle;
286 } isn_arg; 294 } isn_arg;
287 }; 295 };
288 296