mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.2.2349: Vim9: cannot handle line break after parenthesis at line end
Problem: Vim9: cannot handle line break after parenthesis at line end. Solution: Skip over line break. (closes #7677)
This commit is contained in:
@@ -2523,6 +2523,7 @@ enddef
|
|||||||
|
|
||||||
def Test_expr7_parens()
|
def Test_expr7_parens()
|
||||||
# (expr)
|
# (expr)
|
||||||
|
var lines =<< trim END
|
||||||
assert_equal(4, (6 * 4) / 6)
|
assert_equal(4, (6 * 4) / 6)
|
||||||
assert_equal(0, 6 * ( 4 / 6 ))
|
assert_equal(0, 6 * ( 4 / 6 ))
|
||||||
|
|
||||||
@@ -2530,11 +2531,18 @@ def Test_expr7_parens()
|
|||||||
assert_equal(-6, -6)
|
assert_equal(-6, -6)
|
||||||
assert_equal(false, !-3)
|
assert_equal(false, !-3)
|
||||||
assert_equal(true, !+0)
|
assert_equal(true, !+0)
|
||||||
enddef
|
|
||||||
|
|
||||||
def Test_expr7_parens_vim9script()
|
assert_equal(7, 5 + (
|
||||||
var lines =<< trim END
|
2))
|
||||||
vim9script
|
assert_equal(7, 5 + (
|
||||||
|
2
|
||||||
|
))
|
||||||
|
assert_equal(7, 5 + ( # comment
|
||||||
|
2))
|
||||||
|
assert_equal(7, 5 + ( # comment
|
||||||
|
# comment
|
||||||
|
2))
|
||||||
|
|
||||||
var s = (
|
var s = (
|
||||||
'one'
|
'one'
|
||||||
..
|
..
|
||||||
@@ -2542,7 +2550,7 @@ def Test_expr7_parens_vim9script()
|
|||||||
)
|
)
|
||||||
assert_equal('onetwo', s)
|
assert_equal('onetwo', s)
|
||||||
END
|
END
|
||||||
CheckScriptSuccess(lines)
|
CheckDefAndScriptSuccess(lines)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Test_expr7_negate_add()
|
def Test_expr7_negate_add()
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2349,
|
||||||
/**/
|
/**/
|
||||||
2348,
|
2348,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -3554,8 +3554,10 @@ compile_leader(cctx_T *cctx, int numeric_only, char_u *start, char_u **end)
|
|||||||
compile_parenthesis(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
|
compile_parenthesis(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
char_u *p = *arg + 1;
|
||||||
|
|
||||||
*arg = skipwhite(*arg + 1);
|
if (may_get_next_line_error(p, arg, cctx) == FAIL)
|
||||||
|
return FAIL;
|
||||||
if (ppconst->pp_used <= PPSIZE - 10)
|
if (ppconst->pp_used <= PPSIZE - 10)
|
||||||
{
|
{
|
||||||
ret = compile_expr1(arg, cctx, ppconst);
|
ret = compile_expr1(arg, cctx, ppconst);
|
||||||
|
Reference in New Issue
Block a user