summaryrefslogtreecommitdiff
path: root/src/vim9.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-31 22:05:04 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-31 22:05:04 +0200
commit38ddf333f6b2806b0ea2dd052ee1cd50dd7f4525 (patch)
tree5174c1e94e06de25435c40113f6d793eb97659c7 /src/vim9.h
parent4d4d1cd5c8b61ef0296bd6190ca2a0b2d6d96ba7 (diff)
downloadvim-git-38ddf333f6b2806b0ea2dd052ee1cd50dd7f4525.tar.gz
patch 8.2.1329: Vim9: cannot define global function inside :def functionv8.2.1329
Problem: Vim9: cannot define global function inside :def function. Solution: Assign to global variable instead of local. (closes #6584)
Diffstat (limited to 'src/vim9.h')
-rw-r--r--src/vim9.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vim9.h b/src/vim9.h
index 0d51c98b5..77f342712 100644
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -79,6 +79,7 @@ typedef enum {
ISN_PCALL_END, // cleanup after ISN_PCALL with cpf_top set
ISN_RETURN, // return, result is on top of stack
ISN_FUNCREF, // push a function ref to dfunc isn_arg.funcref
+ ISN_NEWFUNC, // create a global function from a lambda function
// expression operations
ISN_JUMP, // jump if condition is matched isn_arg.jump
@@ -237,6 +238,12 @@ typedef struct {
int fr_var_idx; // variable to store partial
} funcref_T;
+// arguments to ISN_NEWFUNC
+typedef struct {
+ char_u *nf_lambda; // name of the lambda already defined
+ char_u *nf_global; // name of the global function to be created
+} newfunc_T;
+
// arguments to ISN_CHECKLEN
typedef struct {
int cl_min_len; // minimum length
@@ -281,6 +288,7 @@ struct isn_S {
script_T script;
unlet_T unlet;
funcref_T funcref;
+ newfunc_T newfunc;
checklen_T checklen;
shuffle_T shuffle;
} isn_arg;