comparison src/vim9cmds.c @ 30088:4eac06fb0191

Revert part of patch merged twice Commit: https://github.com/vim/vim/commit/8f7116caddc6f0725cf1211407d97645c4eb7b65 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 4 18:22:16 2022 +0100 Revert part of patch merged twice
author Bram Moolenaar <Bram@vim.org>
date Sun, 04 Sep 2022 19:30:02 +0200
parents a5417ca098af
children d1c04b4dc60d
comparison
equal deleted inserted replaced
30087:02745db8a289 30088:4eac06fb0191
1704 } 1704 }
1705 return dfunc->df_defer_var_idx; 1705 return dfunc->df_defer_var_idx;
1706 } 1706 }
1707 1707
1708 /* 1708 /*
1709 * Get the local variable index for deferred function calls.
1710 * Reserve it when not done already.
1711 * Returns zero for failure.
1712 */
1713 int
1714 get_defer_var_idx(cctx_T *cctx)
1715 {
1716 dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data)
1717 + cctx->ctx_ufunc->uf_dfunc_idx;
1718 if (dfunc->df_defer_var_idx == 0)
1719 {
1720 lvar_T *lvar = reserve_local(cctx, (char_u *)"@defer@", 7,
1721 TRUE, &t_list_any);
1722 if (lvar == NULL)
1723 return 0;
1724 dfunc->df_defer_var_idx = lvar->lv_idx + 1;
1725 }
1726 return dfunc->df_defer_var_idx;
1727 }
1728
1729 /*
1730 * Compile "defer func(arg)". 1709 * Compile "defer func(arg)".
1731 */ 1710 */
1732 char_u * 1711 char_u *
1733 compile_defer(char_u *arg_start, cctx_T *cctx) 1712 compile_defer(char_u *arg_start, cctx_T *cctx)
1734 { 1713 {