Mercurial > vim
comparison src/structs.h @ 22596:107eae953b87 v8.2.1846
patch 8.2.1846: Vim9: block variables are not found in compiled function
Commit: https://github.com/vim/vim/commit/fbbcd00367e1a4fafd047d42ffce0e5dce88925c
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 15 12:46:44 2020 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 15 Oct 2020 13:00:05 +0200 |
parents | 209c7aa56325 |
children | 71b57779177d |
comparison
equal
deleted
inserted
replaced
22595:a42172375311 | 22596:107eae953b87 |
---|---|
1580 int *uf_def_arg_idx; // instruction indexes for evaluating | 1580 int *uf_def_arg_idx; // instruction indexes for evaluating |
1581 // uf_def_args; length: uf_def_args.ga_len + 1 | 1581 // uf_def_args; length: uf_def_args.ga_len + 1 |
1582 char_u *uf_va_name; // name from "...name" or NULL | 1582 char_u *uf_va_name; // name from "...name" or NULL |
1583 type_T *uf_va_type; // type from "...name: type" or NULL | 1583 type_T *uf_va_type; // type from "...name: type" or NULL |
1584 type_T *uf_func_type; // type of the function, &t_func_any if unknown | 1584 type_T *uf_func_type; // type of the function, &t_func_any if unknown |
1585 int uf_block_depth; // nr of entries in uf_block_ids | |
1586 int *uf_block_ids; // blocks a :def function is defined inside | |
1585 # if defined(FEAT_LUA) | 1587 # if defined(FEAT_LUA) |
1586 cfunc_T uf_cb; // callback function for cfunc | 1588 cfunc_T uf_cb; // callback function for cfunc |
1587 cfunc_free_T uf_cb_free; // callback function to free cfunc | 1589 cfunc_free_T uf_cb_free; // callback function to free cfunc |
1588 void *uf_cb_state; // state of uf_cb | 1590 void *uf_cb_state; // state of uf_cb |
1589 # endif | 1591 # endif |
1790 // Also stores the type. | 1792 // Also stores the type. |
1791 garray_T sn_var_vals; | 1793 garray_T sn_var_vals; |
1792 | 1794 |
1793 garray_T sn_imports; // imported items, imported_T | 1795 garray_T sn_imports; // imported items, imported_T |
1794 garray_T sn_type_list; // keeps types used by variables | 1796 garray_T sn_type_list; // keeps types used by variables |
1795 int sn_current_block_id; // Unique ID for each script block | 1797 int sn_current_block_id; // ID for current block, 0 for outer |
1798 int sn_last_block_id; // Unique ID for each script block | |
1796 | 1799 |
1797 int sn_version; // :scriptversion | 1800 int sn_version; // :scriptversion |
1798 int sn_had_command; // TRUE if any command was executed | 1801 int sn_had_command; // TRUE if any command was executed |
1799 char_u *sn_save_cpo; // 'cpo' value when :vim9script found | 1802 char_u *sn_save_cpo; // 'cpo' value when :vim9script found |
1800 | 1803 |