0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.2288: Vim9: line break and comment not always skipped

Problem:    Vim9: line break and comment not always skipped.
Solution:   Skip over white space and then line break more consistently.
            (closes #7610)
This commit is contained in:
Bram Moolenaar
2021-01-03 18:33:13 +01:00
parent cec77d4530
commit 5afd081cd3
3 changed files with 22 additions and 23 deletions

View File

@@ -43,6 +43,11 @@ def Test_expr1_trinary()
name = 0
assert_equal('two', name ? 'one' : 'two')
echo ['a'] + (1 ? ['b'] : ['c']
)
echo ['a'] + (1 ? ['b'] : ['c'] # comment
)
# with constant condition expression is not evaluated
assert_equal('one', 1 ? 'one' : xxx)
@@ -2084,6 +2089,10 @@ def Test_expr7_dict()
var d = {a: () => 3, b: () => 7}
assert_equal(3, d.a())
assert_equal(7, d.b())
var cd = { # comment
key: 'val' # comment
}
END
CheckDefAndScriptSuccess(lines)
@@ -2665,7 +2674,7 @@ def Test_expr7_not()
enddef
func Test_expr7_fails()
call CheckDefFailure(["var x = (12"], "E110:", 1)
call CheckDefFailure(["var x = (12"], "E1097:", 3)
call CheckDefFailure(["var x = -'xx'"], "E1030:", 1)
call CheckDefFailure(["var x = +'xx'"], "E1030:", 1)