Patch 8.2.3312
Problem: Vim9: after "if false" line breaks in expression not skipped.
Solution: Do parse the expression. (closes #8723)
Files: src/vim9compile.c, src/testdir/test_vim9_script.vim
*** ../vim-8.2.3311/src/vim9compile.c 2021-08-07 16:30:35.109065179 +0200
--- src/vim9compile.c 2021-08-07 18:06:36.060331553 +0200
***************
*** 9730,9743 ****
if (p == ea.cmd && ea.cmdidx != CMD_SIZE)
{
! if (cctx.ctx_skip == SKIP_YES)
{
line += STRLEN(line);
goto nextline;
}
!
! // Expression or function call.
! if (ea.cmdidx != CMD_eval)
{
// CMD_var cannot happen, compile_assignment() above would be
// used. Most likely an assignment to a non-existing variable.
--- 9730,9741 ----
if (p == ea.cmd && ea.cmdidx != CMD_SIZE)
{
! if (cctx.ctx_skip == SKIP_YES && ea.cmdidx != CMD_eval)
{
line += STRLEN(line);
goto nextline;
}
! else if (ea.cmdidx != CMD_eval)
{
// CMD_var cannot happen, compile_assignment() above would be
// used. Most likely an assignment to a non-existing variable.
*** ../vim-8.2.3311/src/testdir/test_vim9_script.vim 2021-08-07
15:05:44.707105779 +0200
--- src/testdir/test_vim9_script.vim 2021-08-07 18:05:59.532417693 +0200
***************
*** 2372,2377 ****
--- 2372,2385 ----
if false
burp
endif
+
+ # expression with line breaks skipped
+ if false
+ ('aaa'
+ .. 'bbb'
+ .. 'ccc'
+ )->setline(1)
+ endif
enddef
def Test_if_const_expr_fails()
*** ../vim-8.2.3311/src/version.c 2021-08-07 17:20:07.966856597 +0200
--- src/version.c 2021-08-07 18:03:47.376729247 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3312,
/**/
--
Some say the world will end in fire; some say in segfaults.
I say it will end in a curly bracket.
/// 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/202108071613.177GDAMn1882570%40masaka.moolenaar.net.