vim-patch:8.1.1686: "*" of "*{" is recognized as multipy operator

Problem:    "*" of "*{" is recognized as multipy operator. (Yasuhiro Matsumoto)
Solution:   Check for the "{".
2898ebb44c
This commit is contained in:
Jan Edmund Lazo 2020-10-07 00:40:33 -04:00
parent 7ca5dc2519
commit d109a33144
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
2 changed files with 3 additions and 1 deletions

View File

@ -3802,8 +3802,9 @@ static int eval6(char_u **arg, typval_T *rettv, int evaluate, int want_string)
*/ */
for (;; ) { for (;; ) {
op = **arg; op = **arg;
if (op != '*' && op != '/' && op != '%') if ((op != '*' || (*arg)[1] == '{') && op != '/' && op != '%') {
break; break;
}
if (evaluate) { if (evaluate) {
if (rettv->v_type == VAR_FLOAT) { if (rettv->v_type == VAR_FLOAT) {

View File

@ -282,6 +282,7 @@ endfunc
func Test_dict_literal_keys() func Test_dict_literal_keys()
call assert_equal({'one': 1, 'two2': 2, '3three': 3, '44': 4}, *{one: 1, two2: 2, 3three: 3, 44: 4},) call assert_equal({'one': 1, 'two2': 2, '3three': 3, '44': 4}, *{one: 1, two2: 2, 3three: 3, 44: 4},)
call assert_equal('2 3', trim(execute('echo 2 *{blue: 3}.blue')))
endfunc endfunc
" Nasty: deepcopy() dict that refers to itself (fails when noref used) " Nasty: deepcopy() dict that refers to itself (fails when noref used)