mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.2.0298: Vim9 script: cannot start command with a string constant
Problem: Vim9 script: cannot start command with a string constant. Solution: Recognize expression starting with '('.
This commit is contained in:
@@ -4821,22 +4821,11 @@ compile_def_function(ufunc_T *ufunc, int set_return_type)
|
||||
p = (*ea.cmd == '&' || *ea.cmd == '$' || *ea.cmd == '@')
|
||||
? ea.cmd + 1 : ea.cmd;
|
||||
p = to_name_end(p);
|
||||
if (p > ea.cmd && *p != NUL)
|
||||
if ((p > ea.cmd && *p != NUL) || *p == '(')
|
||||
{
|
||||
int oplen;
|
||||
int heredoc;
|
||||
|
||||
// "funcname(" is always a function call.
|
||||
// "varname[]" is an expression.
|
||||
// "varname->expr" is an expression.
|
||||
if (*p == '('
|
||||
|| *p == '['
|
||||
|| ((p - ea.cmd) > 2 && ea.cmd[1] == ':')
|
||||
|| (*p == '-' && p[1] == '>'))
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
oplen = assignment_len(skipwhite(p), &heredoc);
|
||||
if (oplen > 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user