1
0
forked from aniani/vim

patch 8.2.4526: Vim9: cannot set variables to a null value

Problem:    Vim9: cannot set variables to a null value.
Solution:   Add null_list, null_job, etc.
This commit is contained in:
Bram Moolenaar
2022-03-08 13:18:55 +00:00
parent 08238045e7
commit 8acb9cc620
16 changed files with 346 additions and 51 deletions

View File

@@ -2107,14 +2107,20 @@ compile_expr8(
break;
/*
* "null" constant
* "null" or "null_*" constant
*/
case 'n': if (STRNCMP(*arg, "null", 4) == 0
&& !eval_isnamec((*arg)[4]))
case 'n': if (STRNCMP(*arg, "null", 4) == 0)
{
*arg += 4;
rettv->v_type = VAR_SPECIAL;
rettv->vval.v_number = VVAL_NULL;
char_u *p = *arg + 4;
int len;
for (len = 0; eval_isnamec(p[len]); ++len)
;
ret = handle_predefined(*arg, len + 4, rettv);
if (ret == FAIL)
ret = NOTDONE;
else
*arg += len + 4;
}
else
ret = NOTDONE;