patch 8.2.3052: Vim9: "legacy call" does not work
Problem: Vim9: "legacy call" does not work.
Solution: Do not skip "call" after "legacy". (closes #8454)
diff --git a/src/vim9compile.c b/src/vim9compile.c
index dd3f3ae..bb5ea97 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -9346,27 +9346,30 @@
break;
}
- // Skip ":call" to get to the function name.
+ // Skip ":call" to get to the function name, unless using :legacy
p = ea.cmd;
- if (checkforcmd(&ea.cmd, "call", 3))
+ if (!(local_cmdmod.cmod_flags & CMOD_LEGACY))
{
- if (*ea.cmd == '(')
- // not for "call()"
- ea.cmd = p;
- else
- ea.cmd = skipwhite(ea.cmd);
- }
+ if (checkforcmd(&ea.cmd, "call", 3))
+ {
+ if (*ea.cmd == '(')
+ // not for "call()"
+ ea.cmd = p;
+ else
+ ea.cmd = skipwhite(ea.cmd);
+ }
- if (!starts_with_colon)
- {
- int assign;
+ if (!starts_with_colon)
+ {
+ int assign;
- // Check for assignment after command modifiers.
- assign = may_compile_assignment(&ea, &line, &cctx);
- if (assign == OK)
- goto nextline;
- if (assign == FAIL)
- goto erret;
+ // Check for assignment after command modifiers.
+ assign = may_compile_assignment(&ea, &line, &cctx);
+ if (assign == OK)
+ goto nextline;
+ if (assign == FAIL)
+ goto erret;
+ }
}
/*
@@ -9375,8 +9378,9 @@
* "++nr" and "--nr" are eval commands
*/
cmd = ea.cmd;
- if (starts_with_colon || !(*cmd == '\''
- || (cmd[0] == cmd[1] && (*cmd == '+' || *cmd == '-'))))
+ if (!(local_cmdmod.cmod_flags & CMOD_LEGACY)
+ && (starts_with_colon || !(*cmd == '\''
+ || (cmd[0] == cmd[1] && (*cmd == '+' || *cmd == '-')))))
{
ea.cmd = skip_range(ea.cmd, TRUE, NULL);
if (ea.cmd > cmd)