To: vim_dev@googlegroups.com Subject: Patch 8.2.1073 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1073 Problem: Vim9: no line break allowed in () expression. Solution: Skip a line break. Files: src/eval.c, src/testdir/test_vim9_expr.vim *** ../vim-8.2.1072/src/eval.c 2020-06-27 18:06:42.148575132 +0200 --- src/eval.c 2020-06-27 20:44:21.690704752 +0200 *************** *** 2453,2458 **** --- 2453,2461 ---- if (op == '.' && *(*arg + 1) == '.') // .. string concatenation ++*arg; *arg = skipwhite(*arg + 1); + eval_next_non_blank(*arg, evalarg, &getnext); + if (getnext) + *arg = eval_next_line(evalarg); if (eval6(arg, &var2, evalarg, op == '.') == FAIL) { clear_tv(rettv); *************** *** 2890,2897 **** --- 2893,2910 ---- * nested expression: (expression). */ case '(': { + int getnext; + *arg = skipwhite(*arg + 1); + eval_next_non_blank(*arg, evalarg, &getnext); + if (getnext) + *arg = eval_next_line(evalarg); + ret = eval1(arg, rettv, evalarg); // recursive! + + eval_next_non_blank(*arg, evalarg, &getnext); + if (getnext) + *arg = eval_next_line(evalarg); if (**arg == ')') ++*arg; else if (ret == OK) *** ../vim-8.2.1072/src/testdir/test_vim9_expr.vim 2020-06-27 18:06:42.152575113 +0200 --- src/testdir/test_vim9_expr.vim 2020-06-27 20:40:33.447800202 +0200 *************** *** 1137,1142 **** --- 1137,1155 ---- assert_equal(true, !+-+0) enddef + def Test_expr7_parens_vim9script() + let lines =<< trim END + vim9script + let s = ( + 'one' + .. + 'two' + ) + assert_equal('onetwo', s) + END + CheckScriptSuccess(lines) + enddef + def Test_expr7_negate() assert_equal(-99, -99) assert_equal(99, --99) *** ../vim-8.2.1072/src/version.c 2020-06-27 18:13:04.966631915 +0200 --- src/version.c 2020-06-27 20:45:36.870341758 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1073, /**/ -- LETTERS TO THE EDITOR (The Times of London) Dear Sir, I am firmly opposed to the spread of microchips either to the home or to the office.  We have more than enough of them foisted upon us in public places.  They are a disgusting Americanism, and can only result in the farmers being forced to grow smaller potatoes, which in turn will cause massive unemployment in the already severely depressed agricultural industry. Yours faithfully,         Capt. Quinton D'Arcy, J. P.         Sevenoaks /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///