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.
diff --git a/src/eval.c b/src/eval.c
index d89093c..20cec16 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -4391,7 +4391,8 @@
* $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
@@ -4576,12 +4577,24 @@
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;
/*