int vim9script = in_vim9script();
int had_comma;
- // First check if it's not a curly-braces thing: {expr}.
+ // First check if it's not a curly-braces expression: {expr}.
// Must do this without evaluating, otherwise a function may be called
// twice. Unfortunately this means we need to call eval1() twice for the
// first item.
- // But {} is an empty Dictionary.
+ // "{}" is an empty Dictionary.
+ // "#{abc}" is never a curly-braces expression.
if (!vim9script
&& *curly_expr != '}'
+ && !literal
&& eval1(&curly_expr, &tv, NULL) == OK
&& *skipwhite(curly_expr) == '}')
return NOTDONE;
" allow key starting with number at the start, not a curly expression
call assert_equal({'1foo': 77}, #{1foo: 77})
+
+ " #{expr} is not a curly expression
+ let x = 'x'
+ call assert_equal(#{g: x}, #{g:x})
endfunc
" This was allowed in legacy Vim script