forked from aniani/vim
patch 8.2.1112: Vim9: no line continuation allowed in method call
Problem: Vim9: no line continuation allowed in method call. Solution: Handle line continuation in expression before method call.
This commit is contained in:
@@ -190,5 +190,22 @@ def Test_for_linebreak()
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_method_cal_linebreak()
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
let res = []
|
||||
func RetArg(
|
||||
arg
|
||||
)
|
||||
let s:res = a:arg
|
||||
endfunc
|
||||
[1,
|
||||
2,
|
||||
3]->RetArg()
|
||||
assert_equal([1, 2, 3], res)
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
|
||||
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
|
||||
|
@@ -1281,9 +1281,9 @@ func Test_expr7_fails()
|
||||
|
||||
call CheckDefFailure(["let x = ''", "let y = x.memb"], 'E715:')
|
||||
|
||||
call CheckDefExecFailure(["[1, 2->len()"], 'E492:')
|
||||
call CheckDefExecFailure(["[1, 2->len()"], 'E697:')
|
||||
call CheckDefExecFailure(["#{a: 1->len()"], 'E488:')
|
||||
call CheckDefExecFailure(["{'a': 1->len()"], 'E492:')
|
||||
call CheckDefExecFailure(["{'a': 1->len()"], 'E723:')
|
||||
endfunc
|
||||
|
||||
let g:Funcrefs = [function('add')]
|
||||
|
@@ -305,7 +305,7 @@ def Test_assignment_failure()
|
||||
call CheckDefFailure(['let true = 1'], 'E1034:')
|
||||
call CheckDefFailure(['let false = 1'], 'E1034:')
|
||||
|
||||
call CheckDefFailure(['[a; b; c] = g:list'], 'E452:')
|
||||
call CheckDefFailure(['[a; b; c] = g:list'], 'E1001:')
|
||||
call CheckDefExecFailure(['let a: number',
|
||||
'[a] = test_null_list()'], 'E1093:')
|
||||
call CheckDefExecFailure(['let a: number',
|
||||
@@ -1979,19 +1979,19 @@ def Test_vim9_comment_not_compiled()
|
||||
'bwipe!',
|
||||
])
|
||||
|
||||
CheckScriptFailure([
|
||||
'vim9script',
|
||||
'new'
|
||||
'call setline(1, ["# define pat", "last"])',
|
||||
':$',
|
||||
'dsearch /pat/#comment',
|
||||
'bwipe!',
|
||||
], 'E488:')
|
||||
|
||||
CheckScriptFailure([
|
||||
'vim9script',
|
||||
'func! SomeFunc()',
|
||||
], 'E477:')
|
||||
" CheckScriptFailure([
|
||||
" 'vim9script',
|
||||
" 'new'
|
||||
" 'call setline(1, ["# define pat", "last"])',
|
||||
" ':$',
|
||||
" 'dsearch /pat/#comment',
|
||||
" 'bwipe!',
|
||||
" ], 'E488:')
|
||||
"
|
||||
" CheckScriptFailure([
|
||||
" 'vim9script',
|
||||
" 'func! SomeFunc()',
|
||||
" ], 'E477:')
|
||||
enddef
|
||||
|
||||
def Test_finish()
|
||||
|
Reference in New Issue
Block a user