summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/testdir/input/vim_ex_function.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:39:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:40:16 +0000
commit6af24b2457752c0d36aaf9f29f03d39afd09937f (patch)
tree2671b594908d1f971de6b2a2d473f97dfb7291d2 /runtime/syntax/testdir/input/vim_ex_function.vim
parentReleasing progress-linux version 2:9.1.0016-1~progress7.99u1. (diff)
downloadvim-6af24b2457752c0d36aaf9f29f03d39afd09937f.tar.xz
vim-6af24b2457752c0d36aaf9f29f03d39afd09937f.zip
Merging upstream version 2:9.1.0199.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/syntax/testdir/input/vim_ex_function.vim')
-rw-r--r--runtime/syntax/testdir/input/vim_ex_function.vim182
1 files changed, 182 insertions, 0 deletions
diff --git a/runtime/syntax/testdir/input/vim_ex_function.vim b/runtime/syntax/testdir/input/vim_ex_function.vim
new file mode 100644
index 0000000..38213b4
--- /dev/null
+++ b/runtime/syntax/testdir/input/vim_ex_function.vim
@@ -0,0 +1,182 @@
+" Vim :function command
+
+
+" list
+
+function
+function Foo
+function /Foo.*
+
+function | echo "Foo"
+function " comment
+function Foo | echo "Foo"
+function Foo " comment
+
+
+" definition
+
+" empty definition
+function Foo()
+endfunction
+
+" curly-brace names
+function {"F"}oo()
+endfunction
+
+function F{"o"}o()
+endfunction
+
+function Fo{"o"}()
+endfunction
+
+function {"F"}o{"o"}()
+endfunction
+
+function {"F"}{"o"}{"o"}()
+endfunction
+
+function Foo()
+ return 42
+endfunction
+
+" trailing whitespace
+function Foo()
+ return 42
+endfunction
+
+function Foo() " comment
+ return 42
+endfunction
+
+function! Foo()
+ return 42
+endfunction
+
+function g:Foo()
+ return 42
+endfunction
+
+function s:Foo()
+ return 42
+endfunction
+
+function <SID>Foo()
+ return 42
+endfunction
+
+function foo#bar#Foo()
+ return 42
+endfunction
+
+" same name as an Ex command
+function s:ls()
+endfunction
+
+
+" modifiers
+
+function Foo() range
+endfunction
+
+function Foo() range " comment
+endfunction
+
+function Foo() range
+ return 42
+endfunction
+
+function Foo() abort
+ return 42
+endfunction
+
+function Foo() dict
+ return 42
+endfunction
+
+function Foo() closure
+ return 42
+endfunction
+
+function Foo() range abort dict closure
+ return 42
+endfunction
+
+function! Foo() range
+ return 42
+endfunction
+
+function! Foo() abort
+ return 42
+endfunction
+
+function! Foo() dict
+ return 42
+endfunction
+
+function! Foo() closure
+ return 42
+endfunction
+
+function! Foo() range abort dict closure
+ return 42
+endfunction
+
+
+" :endfunction trailing
+
+function Foo()
+ return 42
+ " trailing whitespace
+endfunction
+
+function Foo()
+ return 42
+endfunction | echo "Foo"
+
+function Foo()
+ return 42
+endfunction " comment
+
+
+" parameters
+
+function Foo(x, y, z, ...)
+ return 42
+endfunction
+
+function Foo(
+ \ x,
+ \ y,
+ \ z,
+ \ ...)
+ return 42
+endfunction
+
+function Foo(x, y = 42, z = "zed")
+ return 42
+endfunction
+
+function Foo(
+ \ x,
+ \ y = 42,
+ \ z = "zed")
+ return 42
+endfunction
+
+
+" comments
+
+function Foo()
+ " Legacy-script comment
+ # 42 " comment
+ return 42
+endfunction
+
+
+" delete function
+
+delfunction Foo
+delfunction foo.bar
+delfunction! Foo
+delfunction foo.bar
+