diff src/eval.c @ 24047:b535ab17d160 v8.2.2565

patch 8.2.2565: Vim9: "..=" not always recognized Commit: https://github.com/vim/vim/commit/f76ec1eeb5bba9457bf2b5564364ee90662a0156 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 3 17:58:16 2021 +0100 patch 8.2.2565: Vim9: "..=" not always recognized Problem: Vim9: "..=" not always recognized. Solution: Do not consider "..=" to be string concatenation. (closes https://github.com/vim/vim/issues/7905)
author Bram Moolenaar <Bram@vim.org>
date Wed, 03 Mar 2021 18:00:04 +0100
parents 9fcd71d0db89
children d8f3a993dc9a
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -2849,11 +2849,12 @@ eval5(char_u **arg, typval_T *rettv, eva
 	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);