Patch 8.2.2349

5 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 14, 2021, 2:36:45 PM1/14/21
to vim...@googlegroups.com

Patch 8.2.2349
Problem: Vim9: cannot handle line break after parenthesis at line end.
Solution: Skip over line break. (closes #7677)
Files: src/vim9compile.c, src/testdir/test_vim9_expr.vim


*** ../vim-8.2.2348/src/vim9compile.c 2021-01-12 18:58:36.439811827 +0100
--- src/vim9compile.c 2021-01-14 20:29:18.143059577 +0100
***************
*** 3554,3561 ****
compile_parenthesis(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
{
int ret;

! *arg = skipwhite(*arg + 1);
if (ppconst->pp_used <= PPSIZE - 10)
{
ret = compile_expr1(arg, cctx, ppconst);
--- 3554,3563 ----
compile_parenthesis(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
{
int ret;
+ char_u *p = *arg + 1;

! if (may_get_next_line_error(p, arg, cctx) == FAIL)
! return FAIL;
if (ppconst->pp_used <= PPSIZE - 10)
{
ret = compile_expr1(arg, cctx, ppconst);
*** ../vim-8.2.2348/src/testdir/test_vim9_expr.vim 2021-01-10 22:42:46.920847063 +0100
--- src/testdir/test_vim9_expr.vim 2021-01-14 20:34:44.610175262 +0100
***************
*** 2523,2540 ****

def Test_expr7_parens()
# (expr)
! assert_equal(4, (6 * 4) / 6)
! assert_equal(0, 6 * ( 4 / 6 ))

! assert_equal(6, +6)
! assert_equal(-6, -6)
! assert_equal(false, !-3)
! assert_equal(true, !+0)
! enddef

- def Test_expr7_parens_vim9script()
- var lines =<< trim END
- vim9script
var s = (
'one'
..
--- 2523,2548 ----

def Test_expr7_parens()
# (expr)
! var lines =<< trim END
! assert_equal(4, (6 * 4) / 6)
! assert_equal(0, 6 * ( 4 / 6 ))

! assert_equal(6, +6)
! assert_equal(-6, -6)
! assert_equal(false, !-3)
! assert_equal(true, !+0)
!
! assert_equal(7, 5 + (
! 2))
! assert_equal(7, 5 + (
! 2
! ))
! assert_equal(7, 5 + ( # comment
! 2))
! assert_equal(7, 5 + ( # comment
! # comment
! 2))

var s = (
'one'
..
***************
*** 2542,2548 ****
)
assert_equal('onetwo', s)
END
! CheckScriptSuccess(lines)
enddef

def Test_expr7_negate_add()
--- 2550,2556 ----
)
assert_equal('onetwo', s)
END
! CheckDefAndScriptSuccess(lines)
enddef

def Test_expr7_negate_add()
*** ../vim-8.2.2348/src/version.c 2021-01-14 19:19:14.927885317 +0100
--- src/version.c 2021-01-14 20:33:00.566463521 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2349,
/**/

--
hundred-and-one symptoms of being an internet addict:
146. You experience ACTUAL physical withdrawal symptoms when away
from your 'puter and the net.

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages