0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1846: Vim9: block variables are not found in compiled function

Problem:    Vim9: variables declared in a local block are not found in
            when a function is compiled.
Solution:   Look for script variables in sn_all_vars.
This commit is contained in:
Bram Moolenaar
2020-10-15 12:46:44 +02:00
parent 8d739de43b
commit fbbcd00367
11 changed files with 239 additions and 65 deletions

View File

@@ -1582,6 +1582,8 @@ typedef struct
char_u *uf_va_name; // name from "...name" or NULL
type_T *uf_va_type; // type from "...name: type" or NULL
type_T *uf_func_type; // type of the function, &t_func_any if unknown
int uf_block_depth; // nr of entries in uf_block_ids
int *uf_block_ids; // blocks a :def function is defined inside
# if defined(FEAT_LUA)
cfunc_T uf_cb; // callback function for cfunc
cfunc_free_T uf_cb_free; // callback function to free cfunc
@@ -1792,7 +1794,8 @@ typedef struct
garray_T sn_imports; // imported items, imported_T
garray_T sn_type_list; // keeps types used by variables
int sn_current_block_id; // Unique ID for each script block
int sn_current_block_id; // ID for current block, 0 for outer
int sn_last_block_id; // Unique ID for each script block
int sn_version; // :scriptversion
int sn_had_command; // TRUE if any command was executed