1
0
forked from aniani/vim

patch 8.2.2298: Vim9: comment right after "(" of function not recognized

Problem:    Vim9: comment right after "(" of function not recognized.
Solution:   Do not skip over white space before calling get_function_args().
            (closes #7613)
This commit is contained in:
Bram Moolenaar
2021-01-04 14:09:43 +01:00
parent 0ea0440865
commit cef1270dec
4 changed files with 54 additions and 9 deletions

View File

@@ -241,6 +241,42 @@ def Test_call_default_args()
delfunc g:Func
enddef
def FuncWithComment( # comment
a: number, #comment
b: bool, # comment
c: string) #comment
assert_equal(4, a)
assert_equal(true, b)
assert_equal('yes', c)
enddef
def Test_func_with_comments()
FuncWithComment(4, true, 'yes')
var lines =<< trim END
def Func(# comment
arg: string)
enddef
END
CheckScriptFailure(lines, 'E125:', 1)
lines =<< trim END
def Func(
arg: string# comment
)
enddef
END
CheckScriptFailure(lines, 'E475:', 2)
lines =<< trim END
def Func(
arg: string
)# comment
enddef
END
CheckScriptFailure(lines, 'E488:', 3)
enddef
def Test_nested_function()
def Nested(arg: string): string
return 'nested ' .. arg