Mercurial > vim
diff src/vim9compile.c @ 21040:d9e0db9b2b99 v8.2.1071
patch 8.2.1071: Vim9: no line break allowed inside a lambda
Commit: https://github.com/vim/vim/commit/e40fbc2ca9fda07332a4da5af1fcaba91bed865b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 27 18:06:45 2020 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 27 Jun 2020 18:15:03 +0200 |
parents | 2f8b0812819f |
children | 8fb0e507491d |
line wrap: on
line diff
--- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -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 *cct 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 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 != '(')