comparison src/eval.c @ 25620:49a798fa0e73 v8.2.3346

patch 8.2.3346: Vim9: no error for using "." for concatenation after ":vim9cmd" Commit: https://github.com/vim/vim/commit/2596a4e763e11eb8e406f262cb72fd2b39461572 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 14 21:35:40 2021 +0200 patch 8.2.3346: Vim9: no error for using "." for concatenation after ":vim9cmd" Problem: Vim9: no error for using "." for concatenation after ":vim9cmd". (Naohiro Ono) Solution: Check for Vim9 script syntax. (closes #8756)
author Bram Moolenaar <Bram@vim.org>
date Sat, 14 Aug 2021 21:45:03 +0200
parents 54fef15ed370
children 15b54e0a576b
comparison
equal deleted inserted replaced
25619:29ec2c198c8d 25620:49a798fa0e73
2858 // "." is only string concatenation when scriptversion is 1 2858 // "." is only string concatenation when scriptversion is 1
2859 // "+=", "-=" and "..=" are assignments 2859 // "+=", "-=" and "..=" are assignments
2860 // "++" and "--" on the next line are a separate command. 2860 // "++" and "--" on the next line are a separate command.
2861 p = eval_next_non_blank(*arg, evalarg, &getnext); 2861 p = eval_next_non_blank(*arg, evalarg, &getnext);
2862 op = *p; 2862 op = *p;
2863 concat = op == '.' && (*(p + 1) == '.' || current_sctx.sc_version < 2); 2863 concat = op == '.' && (*(p + 1) == '.'
2864 || (current_sctx.sc_version < 2 && !vim9script));
2864 if ((op != '+' && op != '-' && !concat) || p[1] == '=' 2865 if ((op != '+' && op != '-' && !concat) || p[1] == '='
2865 || (p[1] == '.' && p[2] == '=')) 2866 || (p[1] == '.' && p[2] == '='))
2866 break; 2867 break;
2867 if (getnext && (op == '+' || op == '-') && p[0] == p[1]) 2868 if (getnext && (op == '+' || op == '-') && p[0] == p[1])
2868 break; 2869 break;