To: vim_dev@googlegroups.com Subject: Patch 8.2.2726 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2726 Problem: Confusing error message with white space before comma in the arguments of a function declaration. Solution: Give a specific error message. (closes #2235) Files: src/userfunc.c, src/testdir/test_vim9_func.vim *** ../vim-8.2.2725/src/userfunc.c 2021-03-29 22:14:45.604788424 +0200 --- src/userfunc.c 2021-04-06 18:55:34.083812630 +0200 *************** *** 307,312 **** --- 307,323 ---- emsg(_("E989: Non-default argument follows default argument")); goto err_ret; } + + if (VIM_ISWHITE(*p) && *skipwhite(p) == ',') + { + // Be tolerant when skipping + if (!skip) + { + semsg(_(e_no_white_space_allowed_before_str_str), ",", p); + goto err_ret; + } + p = skipwhite(p); + } if (*p == ',') { ++p; *** ../vim-8.2.2725/src/testdir/test_vim9_func.vim 2021-04-05 22:27:33.402532604 +0200 --- src/testdir/test_vim9_func.vim 2021-04-06 19:00:35.835073668 +0200 *************** *** 1263,1268 **** --- 1263,1277 ---- CheckScriptFailure(['def Func5(items)', 'echo "a"'], 'E1077:') enddef + def Test_white_space_before_comma() + var lines =<< trim END + vim9script + def Func(a: number , b: number) + enddef + END + CheckScriptFailure(lines, 'E1068:') + enddef + def Test_white_space_after_comma() var lines =<< trim END vim9script *** ../vim-8.2.2725/src/version.c 2021-04-05 22:27:33.402532604 +0200 --- src/version.c 2021-04-06 18:57:03.499593895 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2726, /**/ -- hundred-and-one symptoms of being an internet addict: 74. Your most erotic dreams are about cybersex /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///