mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.1.1683: dictionary with string keys is longer than needed
Problem: Dictionary with string keys is longer than needed. Solution: Use *{key: val} for literaly keys.
This commit is contained in:
19
src/eval.c
19
src/eval.c
@@ -4391,7 +4391,8 @@ eval6(
|
||||
* $VAR environment variable
|
||||
* (expression) nested expression
|
||||
* [expr, expr] List
|
||||
* {key: val, key: val} Dictionary
|
||||
* {key: val, key: val} Dictionary
|
||||
* *{key: val, key: val} Dictionary with literal keys
|
||||
*
|
||||
* Also handle:
|
||||
* ! in front logical NOT
|
||||
@@ -4575,13 +4576,25 @@ eval7(
|
||||
case '[': ret = get_list_tv(arg, rettv, evaluate);
|
||||
break;
|
||||
|
||||
/*
|
||||
* Dictionary: *{key: val, key: val}
|
||||
*/
|
||||
case '*': if ((*arg)[1] == '{')
|
||||
{
|
||||
++*arg;
|
||||
ret = dict_get_tv(arg, rettv, evaluate, TRUE);
|
||||
}
|
||||
else
|
||||
ret = NOTDONE;
|
||||
break;
|
||||
|
||||
/*
|
||||
* Lambda: {arg, arg -> expr}
|
||||
* Dictionary: {key: val, key: val}
|
||||
* Dictionary: {'key': val, 'key': val}
|
||||
*/
|
||||
case '{': ret = get_lambda_tv(arg, rettv, evaluate);
|
||||
if (ret == NOTDONE)
|
||||
ret = dict_get_tv(arg, rettv, evaluate);
|
||||
ret = dict_get_tv(arg, rettv, evaluate, FALSE);
|
||||
break;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user