Skip to content

Commit 8294d49

Browse files
committed
patch 8.2.1418: Vim9: invalid error for missing white space
Problem: Vim9: invalid error for missing white space after function. Solution: Do not skip over white space. (closes #6679)
1 parent efb6482 commit 8294d49

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/testdir/test_vim9_expr.vim

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ def RetVoid()
706706
let x = 1
707707
enddef
708708

709-
def Test_expr4_vimscript()
709+
def Test_expr4_vim9script()
710710
# check line continuation
711711
let lines =<< trim END
712712
vim9script
@@ -819,6 +819,12 @@ def Test_expr4_vimscript()
819819
echo 2!= 3
820820
END
821821
CheckScriptFailure(lines, 'E1004:')
822+
823+
lines =<< trim END
824+
vim9script
825+
echo len('xxx') == 3
826+
END
827+
CheckScriptSuccess(lines)
822828
enddef
823829

824830
func Test_expr4_fails()

src/userfunc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,10 @@ get_func_tv(
686686
while (--argcount >= 0)
687687
clear_tv(&argvars[argcount]);
688688

689-
*arg = skipwhite(argp);
689+
if (in_vim9script())
690+
*arg = argp;
691+
else
692+
*arg = skipwhite(argp);
690693
return ret;
691694
}
692695

@@ -4097,6 +4100,7 @@ ex_call(exarg_T *eap)
40974100
if (!failed || eap->cstack->cs_trylevel > 0)
40984101
{
40994102
// Check for trailing illegal characters and a following command.
4103+
arg = skipwhite(arg);
41004104
if (!ends_excmd2(eap->arg, arg))
41014105
{
41024106
if (!failed)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1418,
757759
/**/
758760
1417,
759761
/**/

0 commit comments

Comments
 (0)