Patch 8.2.2855
Problem: White space after "->" does not give E274.
Solution: Do not skip white space in legacy script. (closes #8212)
Files: src/eval.c, src/testdir/test_method.vim
*** ../vim-8.2.2854/src/eval.c 2021-05-13 14:55:51.620360842 +0200
--- src/eval.c 2021-05-15 19:50:15.253802768 +0200
***************
*** 5916,5925 ****
}
else if (p[0] == '-' && p[1] == '>')
{
! *arg = skipwhite(p + 2);
if (ret == OK)
{
! if ((**arg == '{' && !in_vim9script()) || **arg == '(')
// expr->{lambda}() or expr->(lambda)()
ret = eval_lambda(arg, rettv, evalarg, verbose);
else
--- 5916,5933 ----
}
else if (p[0] == '-' && p[1] == '>')
{
! if (in_vim9script())
! *arg = skipwhite(p + 2);
! else
! *arg = p + 2;
if (ret == OK)
{
! if (VIM_ISWHITE(**arg))
! {
! emsg(_(e_nowhitespace));
! ret = FAIL;
! }
! else if ((**arg == '{' && !in_vim9script()) || **arg == '(')
// expr->{lambda}() or expr->(lambda)()
ret = eval_lambda(arg, rettv, evalarg, verbose);
else
*** ../vim-8.2.2854/src/testdir/test_method.vim 2021-01-23 15:27:06.378245456
+0100
--- src/testdir/test_method.vim 2021-05-15 19:54:58.348625156 +0200
***************
*** 131,141 ****
eval [1, 2, 3]
\ ->sort(
\ )
! eval [1, 2, 3]-> sort()
call assert_fails('eval [1, 2, 3]->sort ()', 'E274:')
call assert_fails('eval [1, 2, 3] ->sort ()', 'E274:')
call assert_fails('eval [1, 2, 3]-> sort ()', 'E274:')
endfunc
func Test_method_lambda()
--- 131,142 ----
eval [1, 2, 3]
\ ->sort(
\ )
! eval [1, 2, 3]->sort()
call assert_fails('eval [1, 2, 3]->sort ()', 'E274:')
call assert_fails('eval [1, 2, 3] ->sort ()', 'E274:')
call assert_fails('eval [1, 2, 3]-> sort ()', 'E274:')
+ call assert_fails('eval [1, 2, 3]-> sort()', 'E274:')
endfunc
func Test_method_lambda()
*** ../vim-8.2.2854/src/version.c 2021-05-15 17:23:22.886858565 +0200
--- src/version.c 2021-05-15 19:23:25.468331909 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2855,
/**/
--
The greatest lies of all time:
(1) The check is in the mail.
(2) We have a really challenging assignment for you.
(3) I love you.
(4) All bugs have been fixed.
(5) This won't hurt a bit.
(6) Honey, I just need to debug this program and be home in 5 minutes.
(7) I have just sent you an e-mail about that.
(8) Of course I'll respect you in the morning.
(9) I'm from the government, and I'm here to help you.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202105151808.14FI8Z4X3383085%40masaka.moolenaar.net.