patch 8.2.3347: check for legacy script is incomplete
Problem: Check for legacy script is incomplete. (Naohiro Ono)
Solution: Also check the :legacy modifier. Use for string concatenation
with "." and others (issue #8756)
diff --git a/src/eval.c b/src/eval.c
index 020f557..12931af 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2860,8 +2860,7 @@
// "++" and "--" on the next line are a separate command.
p = eval_next_non_blank(*arg, evalarg, &getnext);
op = *p;
- concat = op == '.' && (*(p + 1) == '.'
- || (current_sctx.sc_version < 2 && !vim9script));
+ concat = op == '.' && (*(p + 1) == '.' || in_old_script(2));
if ((op != '+' && op != '-' && !concat) || p[1] == '='
|| (p[1] == '.' && p[2] == '='))
break;
@@ -3402,7 +3401,7 @@
if (**arg == '.' && (!isdigit(*(*arg + 1))
#ifdef FEAT_FLOAT
- || current_sctx.sc_version < 2
+ || in_old_script(2)
#endif
))
{
@@ -5877,7 +5876,7 @@
|| (**arg == '.' && (rettv->v_type == VAR_DICT
|| (!evaluate
&& (*arg)[1] != '.'
- && current_sctx.sc_version >= 2))))
+ && !in_old_script(2)))))
{
dict_unref(selfdict);
if (rettv->v_type == VAR_DICT)