comparison src/evalfunc.c @ 20079:336483164ca6 v8.2.0595

patch 8.2.0595: Vim9: not all commands using ends_excmd() tested Commit: https://github.com/vim/vim/commit/a26b9700d73ebccd6c5459d0d66032a4249f6b72 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 18 19:53:28 2020 +0200 patch 8.2.0595: Vim9: not all commands using ends_excmd() tested Problem: Vim9: not all commands using ends_excmd() tested. Solution: Find # comment after regular commands. Add more tests. Report error for where it was caused.
author Bram Moolenaar <Bram@vim.org>
date Sat, 18 Apr 2020 20:00:04 +0200
parents aadd1cae2ff5
children 63cc54100ae4
comparison
equal deleted inserted replaced
20078:61222b5d173d 20079:336483164ca6
2704 name = s; 2704 name = s;
2705 trans_name = trans_function_name(&name, FALSE, 2705 trans_name = trans_function_name(&name, FALSE,
2706 TFN_INT | TFN_QUIET | TFN_NO_AUTOLOAD | TFN_NO_DEREF, NULL, NULL); 2706 TFN_INT | TFN_QUIET | TFN_NO_AUTOLOAD | TFN_NO_DEREF, NULL, NULL);
2707 if (*name != NUL) 2707 if (*name != NUL)
2708 s = NULL; 2708 s = NULL;
2709 else if (trans_name != NULL
2710 && ASCII_ISUPPER(*s)
2711 && current_sctx.sc_version == SCRIPT_VERSION_VIM9
2712 && find_func(trans_name, NULL) == NULL)
2713 {
2714 // With Vim9 script "MyFunc" can be script-local to the current
2715 // script or global. The script-local name is not found, assume
2716 // global.
2717 vim_free(trans_name);
2718 trans_name = vim_strsave(s);
2719 }
2709 } 2720 }
2710 2721
2711 if (s == NULL || *s == NUL || (use_string && VIM_ISDIGIT(*s)) 2722 if (s == NULL || *s == NUL || (use_string && VIM_ISDIGIT(*s))
2712 || (is_funcref && trans_name == NULL)) 2723 || (is_funcref && trans_name == NULL))
2713 semsg(_(e_invarg2), use_string ? tv_get_string(&argvars[0]) : s); 2724 semsg(_(e_invarg2), use_string ? tv_get_string(&argvars[0]) : s);