comparison src/vim9cmds.c @ 30086:a5417ca098af v9.0.0380

patch 9.0.0380: deleting files in tests is a hassle Commit: https://github.com/vim/vim/commit/fed6bdae6f5f15d842d2e33eda6d3ffbc5b258a7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 4 18:10:11 2022 +0100 patch 9.0.0380: deleting files in tests is a hassle Problem: Deleting files in tests is a hassle. Solution: Use the new 'D' flag of writefile().
author Bram Moolenaar <Bram@vim.org>
date Sun, 04 Sep 2022 19:15:04 +0200
parents a542dfb1c1a2
children 4eac06fb0191
comparison
equal deleted inserted replaced
30085:ebed259f919f 30086:a5417ca098af
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 /*
1709 * Compile "defer func(arg)". 1730 * Compile "defer func(arg)".
1710 */ 1731 */
1711 char_u * 1732 char_u *
1712 compile_defer(char_u *arg_start, cctx_T *cctx) 1733 compile_defer(char_u *arg_start, cctx_T *cctx)
1713 { 1734 {