mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
runtime(vim): Update base-syntax, match multiline return types
fixes #14442. closes: #16914 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
762a79e15c
commit
dd3f1c0dda
60
runtime/syntax/testdir/input/vim_ex_def_return_type.vim
Normal file
60
runtime/syntax/testdir/input/vim_ex_def_return_type.vim
Normal file
@@ -0,0 +1,60 @@
|
||||
vim9script
|
||||
# Vim9 function return types
|
||||
# VIM_TEST_SETUP hi link vimUserType Todo
|
||||
|
||||
|
||||
# Issue #14442 (vim.vim: confusion for function return types starting on another line)
|
||||
|
||||
def TestA______________________________________________________________():
|
||||
\ void
|
||||
enddef
|
||||
|
||||
def TestB____(result: dict<list<number>>, fs: list<func(number): number>):
|
||||
\ void
|
||||
enddef
|
||||
|
||||
def TestC____(maybe: bool, F: func(): dict<func(number): number>): func():
|
||||
\ void
|
||||
return () => {
|
||||
}
|
||||
enddef
|
||||
|
||||
def TestD____(fs: list<func(): dict<func(number): bool>>): func(): func():
|
||||
\ void
|
||||
return () => () => {
|
||||
}
|
||||
enddef
|
||||
|
||||
class Tests
|
||||
def TestA__________________________________________________________():
|
||||
\ void
|
||||
enddef
|
||||
|
||||
def TestB(result: dict<list<number>>, fs: list<func(number): number>):
|
||||
\ void
|
||||
enddef
|
||||
|
||||
def TestC(maybe: bool, F: func(): dict<func(number): number>): func():
|
||||
\ void
|
||||
return () => {
|
||||
}
|
||||
enddef
|
||||
|
||||
def TestD(fs: list<func(): dict<func(number): bool>>): func(): func():
|
||||
\ void
|
||||
return () => () => {
|
||||
}
|
||||
enddef
|
||||
endclass
|
||||
|
||||
def F(G: func(number, number, number): lib.Trampoline):
|
||||
\ func(number, number, number):
|
||||
\ func(): lib.Trampoline
|
||||
return ((H: func(number, number, number): lib.Trampoline) =>
|
||||
(a1: number, a2: number, n: number) =>
|
||||
() =>
|
||||
H(a2, (a1 + a2), (n - 1)))(G)
|
||||
enddef
|
||||
|
||||
defcompile
|
||||
|
Reference in New Issue
Block a user