mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.1378: cannot put space between function name and paren
Problem: Cannot put space between function name and paren. Solution: Allow this for backwards compatibility.
This commit is contained in:
@@ -3198,9 +3198,12 @@ eval7(
|
|||||||
{
|
{
|
||||||
int flags = evalarg == NULL ? 0 : evalarg->eval_flags;
|
int flags = evalarg == NULL ? 0 : evalarg->eval_flags;
|
||||||
|
|
||||||
if (**arg == '(')
|
if ((in_vim9script() ? **arg : *skipwhite(*arg)) == '(')
|
||||||
|
{
|
||||||
// "name(..." recursive!
|
// "name(..." recursive!
|
||||||
|
*arg = skipwhite(*arg);
|
||||||
ret = eval_func(arg, evalarg, s, len, rettv, flags, NULL);
|
ret = eval_func(arg, evalarg, s, len, rettv, flags, NULL);
|
||||||
|
}
|
||||||
else if (flags & EVAL_CONSTANT)
|
else if (flags & EVAL_CONSTANT)
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
else if (evaluate)
|
else if (evaluate)
|
||||||
|
@@ -599,6 +599,11 @@ func Test_expr_eval_error()
|
|||||||
call assert_fails("let v = -{}", 'E728:')
|
call assert_fails("let v = -{}", 'E728:')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_white_in_function_call()
|
||||||
|
let text = substitute ( 'some text' , 't' , 'T' , 'g' )
|
||||||
|
call assert_equal('some TexT', text)
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Test for float value comparison
|
" Test for float value comparison
|
||||||
func Test_float_compare()
|
func Test_float_compare()
|
||||||
CheckFeature float
|
CheckFeature float
|
||||||
|
@@ -1686,6 +1686,10 @@ def Test_expr7_call()
|
|||||||
assert_equal([0, 1, 2], --3->range())
|
assert_equal([0, 1, 2], --3->range())
|
||||||
|
|
||||||
call CheckDefFailure(["let x = 'yes'->Echo"], 'E107:')
|
call CheckDefFailure(["let x = 'yes'->Echo"], 'E107:')
|
||||||
|
call CheckScriptFailure([
|
||||||
|
"vim9script",
|
||||||
|
"let x = substitute ('x', 'x', 'x', 'x')"
|
||||||
|
], 'E121:')
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
|
||||||
|
@@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1378,
|
||||||
/**/
|
/**/
|
||||||
1377,
|
1377,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user