comparison src/userfunc.c @ 24069:324408c61b20 v8.2.2576

patch 8.2.2576: Vim9: defining a :func function checks for white space Commit: https://github.com/vim/vim/commit/608d78fb45077fbaf6dc880b754a1d8a54ac9999 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 6 22:33:12 2021 +0100 patch 8.2.2576: Vim9: defining a :func function checks for white space Problem: Vim9: defining a :func function checks for white space after a comma in the arguments. Solution: Only check for white space in a :def function. (closes #7930)
author Bram Moolenaar <Bram@vim.org>
date Sat, 06 Mar 2021 22:45:03 +0100
parents 308d29307910
children 03fc95628eb0
comparison
equal deleted inserted replaced
24068:0ebc4fb72358 24069:324408c61b20
308 if (*p == ',') 308 if (*p == ',')
309 { 309 {
310 ++p; 310 ++p;
311 // Don't give this error when skipping, it makes the "->" not 311 // Don't give this error when skipping, it makes the "->" not
312 // found in "{k,v -> x}" and give a confusing error. 312 // found in "{k,v -> x}" and give a confusing error.
313 if (!skip && in_vim9script() 313 // Allow missing space after comma in legacy functions.
314 if (!skip && argtypes != NULL
314 && !IS_WHITE_OR_NUL(*p) && *p != endchar) 315 && !IS_WHITE_OR_NUL(*p) && *p != endchar)
315 { 316 {
316 semsg(_(e_white_space_required_after_str_str), ",", p - 1); 317 semsg(_(e_white_space_required_after_str_str), ",", p - 1);
317 goto err_ret; 318 goto err_ret;
318 } 319 }