comparison 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
comparison
equal deleted inserted replaced
21039:4754f242bd14 21040:d9e0db9b2b99
2999 if (eval_dict(&p, &rettv, NULL, TRUE) == FAIL) 2999 if (eval_dict(&p, &rettv, NULL, TRUE) == FAIL)
3000 p = arg; 3000 p = arg;
3001 } 3001 }
3002 else if (p == arg && *arg == '{') 3002 else if (p == arg && *arg == '{')
3003 { 3003 {
3004 int ret = get_lambda_tv(&p, &rettv, FALSE); 3004 int ret = get_lambda_tv(&p, &rettv, NULL);
3005 3005
3006 // Can be "{x -> ret}()". 3006 // Can be "{x -> ret}()".
3007 // Can be "{'a': 1}->Func()". 3007 // Can be "{'a': 1}->Func()".
3008 if (ret == NOTDONE) 3008 if (ret == NOTDONE)
3009 ret = eval_dict(&p, &rettv, NULL, FALSE); 3009 ret = eval_dict(&p, &rettv, NULL, FALSE);
3063 { 3063 {
3064 typval_T rettv; 3064 typval_T rettv;
3065 ufunc_T *ufunc; 3065 ufunc_T *ufunc;
3066 3066
3067 // Get the funcref in "rettv". 3067 // Get the funcref in "rettv".
3068 if (get_lambda_tv(arg, &rettv, TRUE) != OK) 3068 if (get_lambda_tv(arg, &rettv, &EVALARG_EVALUATE) != OK)
3069 return FAIL; 3069 return FAIL;
3070 3070
3071 ufunc = rettv.vval.v_partial->pt_func; 3071 ufunc = rettv.vval.v_partial->pt_func;
3072 ++ufunc->uf_refcount; 3072 ++ufunc->uf_refcount;
3073 clear_tv(&rettv); 3073 clear_tv(&rettv);
3093 typval_T rettv; 3093 typval_T rettv;
3094 int argcount = 1; 3094 int argcount = 1;
3095 int ret = FAIL; 3095 int ret = FAIL;
3096 3096
3097 // Get the funcref in "rettv". 3097 // Get the funcref in "rettv".
3098 if (get_lambda_tv(arg, &rettv, TRUE) == FAIL) 3098 if (get_lambda_tv(arg, &rettv, &EVALARG_EVALUATE) == FAIL)
3099 return FAIL; 3099 return FAIL;
3100 3100
3101 if (**arg != '(') 3101 if (**arg != '(')
3102 { 3102 {
3103 if (*skipwhite(*arg) == '(') 3103 if (*skipwhite(*arg) == '(')