Patch 8.2.1425

3 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 12, 2020, 8:22:30 AM8/12/20
to vim...@googlegroups.com

Patch 8.2.1425
Problem: Vim9: cannot use call() without :call.
Solution: Do not skip over "call(". (closes #6689)
Files: src/vim9compile.c, src/testdir/test_vim9_func.vim


*** ../vim-8.2.1424/src/vim9compile.c 2020-08-11 20:51:03.665789670 +0200
--- src/vim9compile.c 2020-08-12 14:14:57.116825709 +0200
***************
*** 6484,6491 ****
cmdmod = save_cmdmod;

// Skip ":call" to get to the function name.
if (checkforcmd(&ea.cmd, "call", 3))
! ea.cmd = skipwhite(ea.cmd);

if (!starts_with_colon)
{
--- 6484,6498 ----
cmdmod = save_cmdmod;

// Skip ":call" to get to the function name.
+ p = ea.cmd;
if (checkforcmd(&ea.cmd, "call", 3))
! {
! if (*ea.cmd == '(')
! // not for "call()"
! ea.cmd = p;
! else
! ea.cmd = skipwhite(ea.cmd);
! }

if (!starts_with_colon)
{
*** ../vim-8.2.1424/src/testdir/test_vim9_func.vim 2020-08-11 22:30:39.223770448 +0200
--- src/testdir/test_vim9_func.vim 2020-08-12 14:20:15.139768710 +0200
***************
*** 290,295 ****
--- 290,301 ----
CheckScriptFailure(lines, 'E1013:')
enddef

+ def Test_call_call()
+ let l = [3, 2, 1]
+ call('reverse', [l])
+ assert_equal([1, 2, 3], l)
+ enddef
+
let s:value = ''

def FuncOneDefArg(opt = 'text')
*** ../vim-8.2.1424/src/version.c 2020-08-11 23:08:44.820637932 +0200
--- src/version.c 2020-08-12 14:20:44.075668024 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1425,
/**/

--
hundred-and-one symptoms of being an internet addict:
176. You lie, even to user-friends, about how long you were online yesterday.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages