0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2565: Vim9: "..=" not always recognized

Problem:    Vim9: "..=" not always recognized.
Solution:   Do not consider "..=" to be string concatenation. (closes #7905)
This commit is contained in:
Bram Moolenaar
2021-03-03 17:58:16 +01:00
parent 51b477f74f
commit f76ec1eeb5
3 changed files with 45 additions and 3 deletions

View File

@@ -2849,11 +2849,12 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
int vim9script = in_vim9script();
// "." is only string concatenation when scriptversion is 1
// "+=" and "-=" are assignment
// "+=", "-=" and "..=" are assignments
p = eval_next_non_blank(*arg, evalarg, &getnext);
op = *p;
concat = op == '.' && (*(p + 1) == '.' || current_sctx.sc_version < 2);
if ((op != '+' && op != '-' && !concat) || p[1] == '=')
if ((op != '+' && op != '-' && !concat) || p[1] == '='
|| (p[1] == '.' && p[2] == '='))
break;
evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
@@ -3080,9 +3081,10 @@ eval6(
#endif
int error;
// "*=", "/=" and "%=" are assignments
p = eval_next_non_blank(*arg, evalarg, &getnext);
op = *p;
if (op != '*' && op != '/' && op != '%')
if ((op != '*' && op != '/' && op != '%') || p[1] == '=')
break;
evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE);