0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.2.1756: Vim9: :let will soon be disallowed

Problem:    Vim9: :let will soon be disallowed.
Solution:   Add v:disallow_let temporarily.  Fix tests.
This commit is contained in:
Bram Moolenaar
2020-09-27 15:19:27 +02:00
parent c0e29010f6
commit cfcd011fcd
7 changed files with 237 additions and 210 deletions

View File

@@ -3214,19 +3214,20 @@ def_function(exarg_T *eap, char_u *name_arg)
is_heredoc = TRUE;
}
// Check for ":let v =<< [trim] EOF"
// and ":let [a, b] =<< [trim] EOF"
// Check for ":cmd v =<< [trim] EOF"
// and ":cmd [a, b] =<< [trim] EOF"
// Where "cmd" can be "let", "var", "final" or "const".
arg = skipwhite(skiptowhite(p));
if (*arg == '[')
arg = vim_strchr(arg, ']');
if (arg != NULL)
{
arg = skipwhite(skiptowhite(arg));
if ( arg[0] == '=' && arg[1] == '<' && arg[2] =='<'
&& ((p[0] == 'l'
&& p[1] == 'e'
&& (!ASCII_ISALNUM(p[2])
|| (p[2] == 't' && !ASCII_ISALNUM(p[3]))))))
if (arg[0] == '=' && arg[1] == '<' && arg[2] =='<'
&& (checkforcmd(&p, "let", 2)
|| checkforcmd(&p, "var", 3)
|| checkforcmd(&p, "final", 5)
|| checkforcmd(&p, "const", 5)))
{
p = skipwhite(arg + 3);
if (STRNCMP(p, "trim", 4) == 0)