mirror of
https://github.com/vim/vim.git
synced 2025-11-14 23:04:02 -05:00
runtime(vim): Update base syntax, match Vim9 object type constructor
fixes: #18677. closes: #18691 Reported by Aliaksei Budavei. 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
47c30bb03a
commit
59f0ea5b3e
@@ -1,7 +1,7 @@
|
||||
vim9script
|
||||
# Vim9 types
|
||||
# VIM_TEST_SETUP hi link vimTypeAny Todo
|
||||
# VIM_TEST_SETUP hi link vimVariableTypeAny Todo
|
||||
# VIM_TEST_SETUP hi link vim9VariableTypeAny Todo
|
||||
|
||||
|
||||
# builtin types (distinct any highlighting)
|
||||
|
||||
31
runtime/syntax/testdir/input/vim9_types_example_object.vim
Normal file
31
runtime/syntax/testdir/input/vim9_types_example_object.vim
Normal file
@@ -0,0 +1,31 @@
|
||||
vim9script
|
||||
# Vim9 object type constructor
|
||||
# VIM_TEST_SETUP hi link vimTypeObject Todo
|
||||
# VIM_TEST_SETUP hi link vim9VariableTypeObject Todo
|
||||
|
||||
|
||||
# Issue #18677 (No recognition of object<any> types - Aliaksei Budavei)
|
||||

|
||||
interface I
|
||||
def string(): string
|
||||
endinterface
|
||||
|
||||
class C implements I
|
||||
def string(): string
|
||||
return "C"
|
||||
enddef
|
||||
endclass
|
||||
|
||||
enum E implements I
|
||||
INSTANCE
|
||||
|
||||
def string(): string
|
||||
return "E"
|
||||
enddef
|
||||
endenum
|
||||
|
||||
var c: object<C> = C.new()
|
||||
var e: object<E> = E.INSTANCE
|
||||
var os: tuple<object<any>, object<I>> = (c, e)
|
||||
echo (c, e) == os
|
||||
|
||||
27
runtime/syntax/testdir/input/vim9_types_object.vim
Normal file
27
runtime/syntax/testdir/input/vim9_types_object.vim
Normal file
@@ -0,0 +1,27 @@
|
||||
vim9script
|
||||
# Vim9 object type constructor
|
||||
# VIM_TEST_SETUP hi link vimIypeObject Todo
|
||||
# VIM_TEST_SETUP hi link vim9VariableIypeObject Todo
|
||||
|
||||
|
||||
interface I
|
||||
endinterface
|
||||
|
||||
var a: object<I>
|
||||
var b: object<any>
|
||||
var c: object<object<I>>
|
||||
var d: object<object<any>>
|
||||
|
||||
def Foo(
|
||||
arg1: object<I>,
|
||||
arg2: object<any>,
|
||||
arg3: object<object<I>>,
|
||||
arg4: object<object<any>>)
|
||||
enddef
|
||||
|
||||
def Bar(): object<I>
|
||||
enddef
|
||||
|
||||
def Baz(): object<object<I>>
|
||||
enddef
|
||||
|
||||
Reference in New Issue
Block a user