0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.0601: Vim9: :unlet is not compiled

Problem:    Vim9: :unlet is not compiled.
Solution:   Implement :unlet instruction and check for errors.
This commit is contained in:
Bram Moolenaar
2020-04-19 16:28:59 +02:00
parent d3aac2917d
commit d72c1bf0a6
10 changed files with 232 additions and 35 deletions

View File

@@ -5098,6 +5098,7 @@ find_name_end(
int br_nest = 0;
char_u *p;
int len;
int vim9script = current_sctx.sc_version == SCRIPT_VERSION_VIM9;
if (expr_start != NULL)
{
@@ -5106,12 +5107,13 @@ find_name_end(
}
// Quick check for valid starting character.
if ((flags & FNE_CHECK_START) && !eval_isnamec1(*arg) && *arg != '{')
if ((flags & FNE_CHECK_START) && !eval_isnamec1(*arg)
&& (*arg != '{' || vim9script))
return arg;
for (p = arg; *p != NUL
&& (eval_isnamec(*p)
|| *p == '{'
|| (*p == '{' && !vim9script)
|| ((flags & FNE_INCL_BR) && (*p == '[' || *p == '.'))
|| mb_nest != 0
|| br_nest != 0); MB_PTR_ADV(p))
@@ -5151,7 +5153,7 @@ find_name_end(
--br_nest;
}
if (br_nest == 0)
if (br_nest == 0 && !vim9script)
{
if (*p == '{')
{