To: vim_dev@googlegroups.com Subject: Patch 8.2.3312 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///