forked from aniani/vim
patch 8.2.2017: missing part of the dict change
Problem: Missing part of the dict change. Solution: Also change the script level dict.
This commit is contained in:
parent
c6ca9f3a29
commit
67d1c68f09
31
src/dict.c
31
src/dict.c
@ -111,6 +111,7 @@ dict_free_contents(dict_T *d)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Clear hashtab "ht" and dict items it contains.
|
* Clear hashtab "ht" and dict items it contains.
|
||||||
|
* If "ht" is not freed then you should call hash_init() next!
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
hashtab_free_contents(hashtab_T *ht)
|
hashtab_free_contents(hashtab_T *ht)
|
||||||
@ -850,10 +851,32 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
|||||||
*arg = skipwhite_and_linebreak(*arg + 1, evalarg);
|
*arg = skipwhite_and_linebreak(*arg + 1, evalarg);
|
||||||
while (**arg != '}' && **arg != NUL)
|
while (**arg != '}' && **arg != NUL)
|
||||||
{
|
{
|
||||||
if ((literal
|
char_u *p = to_name_end(*arg, FALSE);
|
||||||
? get_literal_key(arg, &tvkey)
|
|
||||||
: eval1(arg, &tvkey, evalarg)) == FAIL) // recursive!
|
if (literal || (vim9script && *p == ':'))
|
||||||
goto failret;
|
{
|
||||||
|
if (get_literal_key(arg, &tvkey) == FAIL)
|
||||||
|
goto failret;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int has_bracket = vim9script && **arg == '[';
|
||||||
|
|
||||||
|
if (has_bracket)
|
||||||
|
*arg = skipwhite(*arg + 1);
|
||||||
|
if (eval1(arg, &tvkey, evalarg) == FAIL) // recursive!
|
||||||
|
goto failret;
|
||||||
|
if (has_bracket)
|
||||||
|
{
|
||||||
|
*arg = skipwhite(*arg);
|
||||||
|
if (**arg != ']')
|
||||||
|
{
|
||||||
|
emsg(_(e_missing_matching_bracket_after_dict_key));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
++*arg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// the colon should come right after the key, but this wasn't checked
|
// the colon should come right after the key, but this wasn't checked
|
||||||
// previously, so only require it in Vim9 script.
|
// previously, so only require it in Vim9 script.
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2017,
|
||||||
/**/
|
/**/
|
||||||
2016,
|
2016,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user