comparison src/structs.h @ 20943:1693ca876049 v8.2.1023

patch 8.2.1023: Vim9: redefining a function uses a new index every time Commit: https://github.com/vim/vim/commit/0cb5bcf5836de83f7d64fb01d3ce708caacaf66c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 20 18:19:09 2020 +0200 patch 8.2.1023: Vim9: redefining a function uses a new index every time Problem: Vim9: redefining a function uses a new index every time. Solution: When redefining a function clear the contents and re-use the index.
author Bram Moolenaar <Bram@vim.org>
date Sat, 20 Jun 2020 18:30:04 +0200
parents a0bc9cecda00
children 0653b9b72091
comparison
equal deleted inserted replaced
20942:484ce6d14734 20943:1693ca876049
1529 1529
1530 #if defined(FEAT_EVAL) || defined(PROTO) 1530 #if defined(FEAT_EVAL) || defined(PROTO)
1531 typedef struct funccall_S funccall_T; 1531 typedef struct funccall_S funccall_T;
1532 1532
1533 // values used for "uf_dfunc_idx" 1533 // values used for "uf_dfunc_idx"
1534 # define UF_NOT_COMPILED -2 1534 typedef enum {
1535 # define UF_TO_BE_COMPILED -1 1535 UF_NOT_COMPILED,
1536 UF_TO_BE_COMPILED,
1537 UF_COMPILED
1538 } def_status_T;
1536 1539
1537 /* 1540 /*
1538 * Structure to hold info for a user function. 1541 * Structure to hold info for a user function.
1539 */ 1542 */
1540 typedef struct 1543 typedef struct
1541 { 1544 {
1542 int uf_varargs; // variable nr of arguments (old style) 1545 int uf_varargs; // variable nr of arguments (old style)
1543 int uf_flags; // FC_ flags 1546 int uf_flags; // FC_ flags
1544 int uf_calls; // nr of active calls 1547 int uf_calls; // nr of active calls
1545 int uf_cleared; // func_clear() was already called 1548 int uf_cleared; // func_clear() was already called
1546 int uf_dfunc_idx; // UF_NOT_COMPILED, UF_TO_BE_COMPILED or >= 0 1549 def_status_T uf_def_status; // UF_NOT_COMPILED, UF_TO_BE_COMPILED, etc.
1550 int uf_dfunc_idx; // only valid if uf_def_status is UF_COMPILED
1547 garray_T uf_args; // arguments, including optional arguments 1551 garray_T uf_args; // arguments, including optional arguments
1548 garray_T uf_def_args; // default argument expressions 1552 garray_T uf_def_args; // default argument expressions
1549 1553
1550 // for :def (for :function uf_ret_type is NULL) 1554 // for :def (for :function uf_ret_type is NULL)
1551 type_T **uf_arg_types; // argument types (count == uf_args.ga_len) 1555 type_T **uf_arg_types; // argument types (count == uf_args.ga_len)