0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1071: Vim9: no line break allowed inside a lambda

Problem:    Vim9: no line break allowed inside a lambda.
Solution:   Handle line break inside a lambda in Vim9 script.
This commit is contained in:
Bram Moolenaar
2020-06-27 18:06:45 +02:00
parent ab19d495fd
commit e40fbc2ca9
12 changed files with 160 additions and 56 deletions

View File

@@ -3001,7 +3001,7 @@ to_name_const_end(char_u *arg)
}
else if (p == arg && *arg == '{')
{
int ret = get_lambda_tv(&p, &rettv, FALSE);
int ret = get_lambda_tv(&p, &rettv, NULL);
// Can be "{x -> ret}()".
// Can be "{'a': 1}->Func()".
@@ -3065,7 +3065,7 @@ compile_lambda(char_u **arg, cctx_T *cctx)
ufunc_T *ufunc;
// Get the funcref in "rettv".
if (get_lambda_tv(arg, &rettv, TRUE) != OK)
if (get_lambda_tv(arg, &rettv, &EVALARG_EVALUATE) != OK)
return FAIL;
ufunc = rettv.vval.v_partial->pt_func;
@@ -3095,7 +3095,7 @@ compile_lambda_call(char_u **arg, cctx_T *cctx)
int ret = FAIL;
// Get the funcref in "rettv".
if (get_lambda_tv(arg, &rettv, TRUE) == FAIL)
if (get_lambda_tv(arg, &rettv, &EVALARG_EVALUATE) == FAIL)
return FAIL;
if (**arg != '(')